Useful WordPress Functions

WordPress Functions

This is a list of useful WordPress functions that I often reference to enhance or clean up my sites. Please be careful and make backups.

Hide WordPress Update Nag to All But Admins

Create Proper WordPress Titles

Update: As of WP 4.1, the long version is no longer required – simply add the following to functions.php and remove the <title> tag from your header.

Create Custom WordPress Dashboard Widget

Remove All Dashboard Widgets

Modify Admin Footer Text

Enqueue Styles and Scripts

Enqueue Google Fonts

Modify Excerpt Length

Change Read More Link

Change More Excerpt

Disable Emoji Mess

Remove Comments

Change Media Gallery URL

Create Custom Thumbnail Size

Retrieve Thumbnail

Since WordPress 4.4.0 you can use:

Add Categories for Attachments

Add Tags for Attachments

Add Custom Excerpt to Pages

Create a Global String

Retrieve Field

Support Featured Images

Support Search Form

Excluding pages from search

Disable xmlrpc.php

Escape HTML in Posts

Modified from Escape HTML.

Create Custom Global Settings

Retrieve Field

Modified from Create a WordPress Theme Settings Page with the Settings API.

Remove WordPress Admin Bar

Add Open Graph Meta Tags

Add Custom Post Type

Implement Preconnect to Google Fonts in Themes

Add Thumbnail Column to Post Listing

Add Lead Class to First Paragraph

Adds a lead class to the first paragraph in the_content.


Vijayan J

Thanks for stopping by guys! I’m Vijayan and Techpulse is my beloved brainchild.
Currently working as a PHP developer in a digital marketing start-up, I’m overly passionate about not just learning new things but also putting those into practice. I swear by a quote I once came across…
‘What separates successful people from unsuccessful people is the former’s ability to execute’.
Feel free to reach out to me if you have any questions, suggestions or feedback. Hoping to see more of you here!