How to Speed up WordPress Blog for MAX Performance – 12 Tips [WP Weekend]

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 speed up your blog. Read on.

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.

Speed up WordPress Blog
Speed up your WordPress site

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 define('WP_POST_REVISIONS', false);

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

You can use this tool (or  WP JS WordPress plugin) to compress your JS as well as concatenate them into a single file easily.

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

Strongly recommended that you avoid too many javascript/widgets as much as possible. If you really need them, put them towards the end of the page load.

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

Add expires headers to ensure that regular visitors of your site witness a fast download, especially for images. Expires header specifies a time far enough in the future so that browsers won’t try to re-fetch images, CSS, javascript etc files that haven’t changed (this reduces the number of HTTP requests) and hence the performance improvement on subsequent page views. Add the following code in .htaccess #Expire Header ExpiresDefault “access plus 2 hours”

Other Useful Resources

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

img credit


Powered By
verisign-ad

Leave your vote

0 points
Upvote Downvote

Discuss

You May Also Like