This is your guide to boost your wordpress blog performance, especially if you care about user experience and do not want to wait them till eternity for your blog to load. These are useful tips/ways to optimize your blog for super performance.
1. Remove Inactive Plugins
In general, there is a tendency for us to try out plugins and if we aren’t happy with the results, we deactivate them and leave that in the server. Dont. Remove all of your inactive plugins right away. Also, if you have activated a plugin and aren’t using it, you might just apply for WP-Sinner award.
2. Post Revisions
This feature was added in wordpress 2.6 and the flip side of this feature is that it just loads your DB with extra records. It’s recommended that you disable post revisions. Add this code in wp-config file
3. Use Code, as much as possible
Avoid using sidebar widgets (yes! we mean this). Use as much code as possible. For instance, displaying ‘Recent Posts/Comments/’ etc can be easily added via code. Before you add widgets, hit Google and search for the php code. Ensure that you first test out the code in your local machine (read Simple Steps to Install WordPress on your Computer), before pushing them to production server.
4. Minimize PHP and HTTP Calls
Everytime your site loads, wordpress executes PHP code/hits the DB and it’s advisable that you minimize the need to hit DB for queries that do not add any value. For instance, instead of this
<link rel=”stylesheet” type=”text/css” media=”screen” href=”<?php bloginfo(’stylesheet_url’); ?>” /> Can be changed to:
<link rel=”stylesheet” type=”text/css” media=”screen” href=”http://NextBigWhat.com/wp-content/themes/abc/style.css” /> Other piece of code that can be removed:
- Remove the reference to wordpress version from header.php (this is also because of security reasons, read: Guide to Protect your WordPress Installation [Security plugins/Tips])
- Remove the code to check the site url (i.e.‘Home’ link) , i.e.
<?php wp_head(); ?>and instead directly add via href tag.
- Remove title code <?php bloginfo(’name’); ?>/<?php bloginfo(’description’); ?> and hardcode these.
5. Compress CSS
Before your minify your CSS, find out the percentage of irrelevant code present in your css file. use Google PageSpeed plugin. You will be surprised to see the results. In general, your CSS file will have a lot of whitespace and minifying CSS will help you in trimming class names, removing white space and will reduce the css file size. Use this tool (or WP CSS plugin)to compress your CSS files, though its important to note that you need to add the theme comment code (i.e. author name/url/description etc) after you have compressed the code.
6. Compress JS
7. Remove Unused Tables/Clean Uninstall
Most likely, you installed a plugin, used it for few days and removed it later. What really happens in the entire process is that the table created by plugin remains and just adds to overhead. Use this plugin Clean Options that finds orphaned options and allows for their removal from the wp_options table.
8. WP-SuperCache/WP-Cache Plugin
There is an ongoing debate between WP-Cache and WP-SuperCache plugin and while we do use WP-SuperCache plugin, we haven’t seen any serious improvement in site performance. So we leave the decision to you.
9.Avoid Unnecessary JS
10. Optimize Images
You can either use Amazon S3 server for hosting images or simply use this plugin WP-Offload that boosts the performance of your blog by offloading static content like images, documents and movies.
11. Use Google CDN
Google hosts tons of popular scripts and its advisable that you link them to Google network (i.e. AJAX Library APIs) than load your own script.
12. Header Expiry
#Expire Header ExpiresDefault “access plus 2 hours”
Other Useful Resources
- Configure Apache for maximum performance
- 5 Tips to Help Your Slow or Sluggish Blog or Web Site
- The 3 Easiest Ways to Speed Up WordPress
Disclaimer – Some of these tips works as-mentioned, but few of them (for instance, JS compress) needs a little bit of experience, so use your judgment.
Also, the core idea behind this post is to increase the awareness about some mistakes that most of us commit, when it comes to using wordpress.
Other WordPress Resources
- WordPress Themes for Microblogging – Build Twitter like Collaboration using WordPress
- How to setup an E-Commerce site with WordPress? [Wordpress Weekend]
- Free WordPress Plugins to Build Mobile Friendly Blog [Wordpress Weekend]
- Top Twitter Plugins for WordPress Blogs [The Complete List]
- WordPress Hack – How to Share Adsense Revenue with Multiple Authors?