Main Menu

50 Most-Wanted WordPress Tips, Tricks and Hacks

Previously we have featured more than 30 hacks and tricks to customize WordPress. But WordPress has been through several iterations and updates since the publication of that compilation. Some WordPress functions has been dropped, some have been replaced with better approaches that render some tricks you know no longer usable.

We figured that you might want new tips, tricks and hacks that do work with the latest version of WordPress. Here are 50. As a friendly reminder, please practice caution when attempting any of the tips in the Advanced section because you might render your site unusable if you don’t know what you are doing.

1. Disabling Full-Height Editor

WordPress 4.0 added a subtle UX change in the editor. If you are scrolling or writing a length paragraph, the height of the editor will match the height of your screen, eliminating the scroll-bars inside the editor.

To reach some panels like the Excerpt and Custom Fields that reside below the editor, you need to scroll all the way down through the end of paragraph. If you don’t want this, tick the option off in the Screen Options panel.

Compatibility: WordPress 4.0

2. Embed Before and After Image Comparison

Have you ever experienced image comparison where you can slide to the right to see the before and to the left for the after? If you want to display something like that on your website, you can install TwentyTwenty. This plugin is based on Zurb TwentyTwenty. The plugin introduces a new shortcode, [twentytwenty], where you can add two images to compare.

Compatibility: WordPress 3.5.1 or higher

3. Revert Plugins or Themes to Previous Version (Easily)

As with any other system update, there is a chance that a new plugin or theme update may accidentally screw up your website. WordPress does not allow us to revert to the previous version but you can install this plugin WP-Rollback to get that functionality. Once it is activated it will add a link “Rollback” on any installed plugin.

Compatibility: WordPress 3.8 or higher

4. Organize Admin Menu

Use this plugin, Admin Menu Manager, to organize each menu order in admin via a drag-and-drop interface.

Compatibility: WordPress 4.0 or higher

5. Text Editor SyntaxHighlighter

The WordPress text-mode editor is pretty plain. You can make it more user-friendly by installing HTML Editor SyntaxHighlighter, a plugin that adds syntax coloring like in a code editor. It will make editing a lot easier, especially if you use Text-mode editor more often than the Visual (WYSIWYG) counterpart.

Compatibility: WordPress 3.3 or higher

6. Adding Icon in Menu

7. Enabling Voice Search

WordPress search is poorly built, cumbersome, and don’t let me start on its search result accuracy. But don’t let that stop you from adding voice search capability to it. Once installed you will notice a “microphone” icon appear in the search box.

Compatibility: WordPress 2.6 or higher

8. Install WordPress Plugin via Github

Did you find a WordPress plugin in Github that you want to install in your website? Follow this tip on how to install plugins conveniently with just a few clicks. Be careful though of what you install as plugins are not moderated. There may be a chance that malicious codes may allow infiltration of your website.

Compatibility: WordPress 3.6 or higher

9. Install Plugin with Single Click

For more plugin management, you could install WP-Core. This is a plugin that makes WordPress plugin installations more streamlined. You can also makes a Collection to put several plugins together and install them with one click.

Compatibility: WordPress 3.5 or higher

10. Advanced Image Styles

We used to able to set margins and borders when we insert images to the content. From WordPress 3.9 onwards, these options were removed. If you missed them, you can install this plugin to bring these options back.

Compatibility: WordPress 3.9 or higher

11. Show Disk Usage Chart

Install this plugin Disk Usage Sunburst to display a beautiful visualization, similar to DaisyDisk, of your website disk space usage. A quite useful utility to add to your website.

Compatibility: WordPress 4.0 or higher

Advanced

Beyond this point are advanced tips and tricks for those who feel like exploring, and those who enjoy getting their hands dirty with codes. However, many of the following tips may render your website unusable, hence they should be carried out with more attention and with extra caution.

12. WordPress Output Debug File

This snippet will tell WordPress to save the debug log error in a .log file instead of displaying it in the front-end. A handy snippet to enable WordPress debugging in a live site.

13. Using Jetpack Modules – Offline

Run and enable all Jetpack modules offline including the modules that actually requires you to connect to WordPress.com to work; a useful tip if you are developing and integrating Jetpack modules to your theme.

Compatibility: WordPress 4.1

14. Login to WordPress with Email Address

WordPress exposes a user’s username, which makes it a step easier for brute-force attacks. You can consider changing login parameters with an email and password combination instead of by username using this hack.

Another way you can use is by installing Disabler plugin. It is a plugin that allows you to turn on or off certain WordPress functionality including disabling self-ping.

Compatibility: WordPress 2.0

16. Pre-Populate Content

This tip is quite useful if you want to add default content each time you create a new post, page, or custom post type content; the idea is similar to adding a standard signature when creating new emails.

Compatibility: WordPress 1.5

17. Custom Class for Post

The following tip explores some customization of WordPress Post Class thoroughly with post_class. It’s helpful if you want to be more specific with regards to your post styles.

Compatibility: WordPress 2.7

18. Adding Google Fonts (the Right Way)

Another great tip from ThemeShaper, a complete guide to add Google Font to your WordPress Theme correctly. It includes how to add it in the front-end, in the editor, and how to ensure compatibility for different languages.

20. WordPress Theme Customizer from Scratch

WordPress 3.4 adds a new API called Customizer which allows you to build controls to customize theme and see the result in real-time. The Customizer API may be overwhleming for some, though, as it involves multi-disciplinary code sets including PHP, JavaScript, Ajax, and jQuery.

Nonetheless, Theme Foundation has compiled a complete guide to WordPress Customizer. You will learn how to add the Customize menu, build Sections, Settings, Input Controls as well as Panels, and learn their functions all together – in and out. An essential reference for WordPress theme developers.

Compatibility: WordPress 3.4

21. Using Vagrant with WordPress

Vagrant is a great tool to create a virtual environment, and to run a test of your WordPress development to ensure that themes and plugins would work in varying instances. In this following tip, Daniel Pataki, will walk you through how to get your WordPress site up and running with Vagrant.

Compatibility: Any WordPress Version

22. Retrieving WordPress Gravatar URL

The WordPress get_avatar() is a handy function to get a user’s avatar; the function retrieves the image along with the img element. But sometimes I want to grab just the image URL so that I could freely and easily add custom classes or ids to the image.

If you have this in mind, add the following code in your functions.php:

23. Remove Classes From Menu

WordPress, by default, adds a bunch of classes. While this is good to allow extensive customization, the menu HTML markup looks really cluttered. Tidy it up and add only the class you need with the snippet below.

24. Applying SSL In WordPress Multisite

SSL, not only secures your website, but also bumps up the rankings in Google search result. In the following tip, Jenni McKinnon covers how to deploy SSL in WordPress multisites that may employ multiple sub-domains.

Compatibility: WordPress 3.0.0

25. Customizing WordPress Content Editor

Adding styles to the editor will improve the writing experience in WordPress editor. You can match the typographic styles of the backend with the front-end allowing you to see the final version (or a version as close to the final as possible) while writing. This will reduce the switching of back and forth between the editor and the content output.

26. Creating Plugin Welcome Screen

If you have just updated WordPress you will be redirected to a special screen, showing the details of the latest version you have just installed, the contributors, the additions as well as all the changes made under the hood. This tip, Creating a Welcome Screen For Your WordPress Plugin by Daniel Pataki will guide you through how to build a welcome screen for your own plugin.

Compatibility: WordPress 3.6

27. Customize Jetpack Mobile Theme

Jetpack comes with a Mobile Theme. It is a special theme that is used when the website is viewed on mobile devices. And like any other theme, we can customize it. Here’s a how-to by Jeremy, one of Jetpack developers, on how to customize the Jetpack Mobile Theme. It’s a good alternative to consider in place of responsive web design.

Compatibility: WordPress 3.8

28. Adding Featured Image To Category

Want to add a featured image for a Category and display it in your theme? This feature is missing from WordPress, which could actually be useful for theme developers.

Compatibility: WordPress 3.6

29. Display Hidden “All Settings”

A WordPress easter egg, this code snippet will add all settings in the WordPress database into one page.

30. Remove Update Notification

WordPress, by default, display update notifications to all user levels when they are logged in to the backend. Add the following codes to hide WordPress update notification except for users with Administrative privilege.

31. Add Thumbnail In Post/Page Edit List

This code will display featured images you have assigned to post in the Post column. A useful trick to see which post has a thumbnail and which does not. Note that your theme should support post thumbnails.

37. Prolong Auto-logout

WordPress allows one to remain logged in for 48 hours, plus an extension of 14 days if we check the “Remember Me” option at login. If however you are sure your computer will not be breached by a second or third party, you can add this code to keep yourself logged in for up to a year. You will only be prompted for a login once a year.

39. Change Default Role Name

“Administrator”, “Author”, and “Subscriber” are the names given for WordPress users at the administrative level. To change these default names to something that sounds more apt for your website, add the following code, then make the change to the names to what you prefer:

41. Validate Featured Image

Some of us prefer posts to be released with a Featured Image. This post, Validate Featured Image On Post, by Paul Underwood will show you how to make your users upload a featured image before their post can be published.

Compatibility: WordPress 3.0

42. Custom Image Size In Media Uploader

add_image_size is the WordPress function that allows us to crop and display custom image size. If you want to allow users to add image within this custom size, add the following codes to show the “custom image size” option in the WordPress media uploader.

43. Load Script Only If A Particular Shortcode Is Present

In a previous post we have shown you how to create a custom shortcode. If your shortcode requires a JavaScript function, follow The Jedi Master way by Silviu-Cristian Burcă (famously known as Scribu) to ensure that you only load the JavaScript when the shortcode is applied.

Compatibility: WordPress 2.6

44. Menu Description

When you add in a menu through Appearance > Menu, you will see an input to add “Description”. But you won’t find it anywhere in the front-end as we have to customize the WordPress default menu template to include the description.

45. Using Dashicons

You can now use WordPress’s very own crafted font icon, Dashicons, to add icons to the wp-admin menu. Check out our tutorial on how to start using Dashicons.

Compatibility: WordPress 3.8

46. Customize “Howdy” Message

Follow our previous tutorial to change the WordPress nonsensical “howdy” message that appears at the admin bar to something more personalized.

Compatibility: WordPress 2.9

47. Exclude Post From The Jetpack Popular Widget

Jetpack comes with a widget that allows you to show the most viewed or popular posts and pages. But sometimes your most popular pages could be the home page or a page that you do not want to include in the most viewed pile.

Replace the ID shown in the snippet with the ID of the post or page you want to remove.

Compatibility: WordPress 4.0 and Jetpack 3.3

48. Truncate Post Title

The following snippet controls the maximum title length. Add the following snippet in functions.php. Then use the function customTitle() in the template to output the title in place of the WordPress the_title() method.

If you build a WordPress Theme with a tiled layout where the tile height has to be equal, you might want to specify the limit of the title length. This snippet should come in handy in that case.

Compatibility: WordPress 3.0

49. Remove WordPress Logo

WordPress 3.1 adds an admin bar, which includes a handful of links and the WordPress logo. If you are going to handout websites to a client and you want it to be brandless, here is the function to remove that WordPress logo.

50. QR Code with Link to Article

Improve your website accessibility for mobile devices with QR codes. This code allows you to display QR codes with a link pointing to the article. Mobile users with a QR code scanner can obtain the article link for quick viewing on their mobile devices.