Tips and tricks for easier WordPress development


These might not be life-changing development tips to some, but I find these tricks – found on various sites like /r/wordpress and Hacker News – to be really handy.

Add a class to a header item via Appearance > Menus

No more targeting #menu-item-123 and hoping it doesn’t change position, or some crazy Javascript acrobatics!

In Appearance > Menus, pull down the Screen Options tab and select CSS Classes. Now you can add your own CSS class to specific menu items. Game changer.

Avoid having to change URLs in the database

I’ve used this tip for years and it generally helps clear up the majority of link issues when moving from development site to live*.

Add the following lines below your database config settings in wp-config.php:

define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]);
define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’]);

*Note: this doesn’t fix the issue of hard-coded links within content (still got to find & replace the post_content for that). Also, this only works for http:// sites, not https://.

Send your client to /admin/ instead of /wp-admin/

I’ve always found it a lot easier to explain to clients that their admin section of the site is simply located in http://www.example.com/admin/. Handy and helps spend less time dealing with clients and more working on code.

Test your theme with WP-Test

Once you’ve created your theme for your client, you and they will usually want some reassurance that once the job is done they will be able to do 100% of the CMS-based tasks that they want to do – without restriction. The best way to ensure that your custom theme can provide that level of functionality is to use WP TEST’s amazing set of data, which you can see at this demo site.

  • Download the latest data set from http://wptest.io/
  • Install a base version of WordPress and activate your theme
  • Tools > Import the data provided by WP TEST
  • Check the results!

Don’t pirate premium themes!


It would be safe to assume that most pirated copies of premium / paid-for WordPress themes contain similar malware. It appears that in this download all the other themes were similarly infected. — Sam Parkinson

Finally, a fantastic post by Sam Parkinson called “Why Pirating Premium WordPress Themes is a Bad Idea” explains the multitude of reasons as to why you should never ever download and use a pirated version of a premium theme. Along with the main reason that stealing is illegal, basing a client or a personal site off an already vulnerable theme is obviously a very bad idea.


I’m Andy Girvan, Freelancer and Founder of thirtydigital, a web and app innovation consultancy. Follow me on Twitter: @andygirvan


Also if you liked this post, make sure you click Recommend to help share it around! Thanks!