Templateo - Website Templates

20 Tips and Tricks to Speed-Up Your Wordpress Blog

by Alex
Posted in Resources on August 25th, 2008

The Wordpress content management system (CMS) is by default a pretty fast and optimized software. However by using lots of plugins and “design heavy” themes can really slow it down. This affects directly your visitors because nobody likes a slow loading website.

There are a number of things you can do to speed up your Wordpress blog, and quite a lot of methods will be discussed in this article.

Lets assume that you have created a killer article and you know that it will bring tons of traffic once you digg or stumble it. Now tons of users are on your blog and your blog serving them content using the dynamic PHP scripts files, this will put tremendous load on your sever and even you can face CPU outage. This is more likely to happen when you have a self-hosted blog.

If you can make static mirror pages of your blog posts, it will save you and your server. WP-Super-Cache plugin does exactly that and we will discuss in great deal in this tutorial. You should also consider following steps to reduce page load time

  1. Use fewer images.
  2. Optimize images before uploading. You can either use Photoshop to optimize JPEG files or use a JPEG compression utility like Advanced JPEG Compressor 2008. Create an action in Photoshop so that you don’t have to do repetitive tasks.
  3. Use minimum third party java script code; they really slow down the page load.
  4. Stay up to date with the latest WP releases. Every new wordpress release comes with lots of performance enhancements. Also don’t forget to update the maintenance release that follows every main release.
  5. Disable or preferably delete unused plugins. Every plugin executes quite a few scripts and SQL queries that might slow down your blog. Deleting unused plugins will save you some space.
  6. Stay up to date with Plugins, whenever a new WP version is released, plugin authors enhance plugins for performance and other enhancements. If you publish your posts from desktop visit your dashboard often to check weather a new version of plugins is available. WP 2.6 now gives you a visual indication about the plugins that need your attention. It shows a red blurb with a number inside it, that number defines how many plugins need your attention.
  7. If you have added a new feature to your WP blog by writing some PHP code that executes SQL queries; make sure that you minimize the load on the server.
  8. Place javascript code in an external .js file instead of dumping all the code in head section. Compress javscript code. A good resource for that is : http://javascriptcompressor.com/
  9. Put external javascript files below the head tag.
  10. Remove duplicate scripts.
  11. Compress all CSS files.
  12. Do not put CSS documents outside HEAD tag.
  13. Check Firefox Error Console and eliminate errors from your code, if any.
  14. Check website load time using a cool utility called Pingdom.20 Tips and Tricks to Speed-Up Your Wordpress Blog 1

    20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 2

  15. Reduce whitespaces in your CSS files and use shorthand CSS. It will increase the speed time. Whitespaces are great and every coder uses them extensively for better reading. The solution to this problem is that you make a copy of code on you local machine, kill all the whitespaces and upload the optimized the file to server. That way you will have a mirror of the code that you can read and modify easily later. Use Pingdom to check wheather it makes any difference or not.
  16. Optimize database using phpMyAdmin.
  17. Use Firebug Firefox addon to quickly find errors on your page. Apart from this you can do tons of thing with firebug including monitoring network utility.20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 3

    https://addons.mozilla.org/firefox/addon/1843

  18. Install YSlow Firefox addon. YSlow analyzes web pages and tells you why they’re slow based on Yahoo’s rules for high performance web sites.20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 4

    https://addons.mozilla.org/en-US/firefox/addon/5369

  19. Reduce DNS lookup, try to reduce number of domains to 4.
  20. And now the most important step, enable cache option. Use a very nice plugin called WP Super Cache, it is an advanced version of WP-Cache however you can choose which mode to turn on when you activate the plugin i.e. WP-Cache or WP-Super-Cache.

WP-Super-Cache plugin is a very fast cashing engine for wordpress. It generates static HTML files from dynamic blog posts. Once this plugin generates a static html file, that file will be executed in your browser instead of the wordpress PHP scripts that are much heavier and take far more time to load.

Static files are only displayed to following set of visitors…

  1. Users who are not logged in.
  2. Users who have not left a comment on your blog.
  3. Or users who have not viewed a password protected post.

It is correct because when user’s details are displayed on the post after they leave comments. These visitors are served dynamically and they are very few in numbers so your server is safe from being overload. Now lets study the plugin.

  1. Enable mod mime, mod rewrite and fancy permalinks on.
  2. Disable PHP safe mode.
  3. If above two settings are missing, you can still cache files but caching will be slow.

Step - 1

Open your .htaccess file, it should be in your website root. Insert following code into it.

# BEGIN WordPress
<IfModule mod_rewrite.c>
 
RewriteEngine On
RewriteBase /iblog/
 
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{QUERY_STRING} !.*p=.*
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_wordpresswp-postpass_).*$
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
 
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{QUERY_STRING} !.*p=.*
RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_wordpresswp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /iblog/index.php [L]
 
</IfModule>
 
# END WordPress

Step – 2

Create a new .htaccess file inside wp-content/cache folder and insert following code in it.

	`AddEncoding x-gzip .gz`
	`AddType text/html .gz`

Step – 3

Copy wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php. You have to copy the file wp-super-cache/wp-cache-config-sample.php to wp-content and rename it as wp-cache-config.php. Make sure that WPCACHEHOME variable is pointing to correct direction.

define( 'WPCACHEHOME', WP_CONTENT_DIR . '/plugins/wp-super-cache/' );

Step – 4

Copy /plugins/wp-super-cache/wp-cache-phase1.php to wp-content folder and rename it as advanced-cache.php.

Step – 5

Open wordpress config file \wp-config.php and add following code just above

require_once(ABSPATH . 'wp-settings.php');

So entire code block will look like…

if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');
	define( 'WP_CACHE', true );
	require_once(ABSPATH . 'wp-settings.php');

Step – 5.1

Choose Settings > WP Super Cache. Now you should see options. You can turn on and off cache from there. You can even set legacy WP-Cache caching from there by clicking on the HALF ON radio button.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 5

Step – 6

Next you can enable or disable compression from there.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 6

If your browser keeps asking you to save the file disable the compression.

Step – 7

Next you can set the expiry time and garbage collection numbers. By default a very high frequency has been set because new WP-Super-Cache plugin works much better then legacy WP-Cache plugin. If your site starts to slow down, decrease the time and also the garbage collection. Garbage collection number defines, How often should expired files be deleted?

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 7

How would you know about the appox number? Well read out few lines below Garbage Collection options.

Checking for and deleting expired files is expensive, but it’s expensive leaving them there too. On a very busy site you can leave this fairly high. Experiment with different values and visit this page to see how many expired files remain at different times during the day. Simple rule of thumb: divide your number of daily page views by 5 and pick the closest number above.

Step – 8

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 8

Next you can set the rejected URIs.

Enter strings here that forces a page not to be cached. For example if you don’t want to cash last year entries enter /2007/ in the box. If any uri accessed that contains the substring /2007/, WP Super Cache will not cache that page.

Step – 9

Next you can set the filenames that can be cached, even if they match one of the rejected substring specified in step-8.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 9

Step – 10

Next set the options to prevent WP-Cache from caching bot, spiders, and crawlers’ requests.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 10

Step – 11

Next this plugin displays number of Cached and Expired pages for both WP-Cache and WP-Super Cache and you also have two buttons for deleting Expired and Cached pages.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 11

Step –12

If you are expecting huge digg traffic on a page, cache that page directly. Directly cached files are files created directly off where your blog lives. Lets assume that you have a uri http://www.yourblog.com/game/ and you are expecting huge traffic from digg. You can enter either http://www.yourblog.com/game/ or /game/ in the box. Click on update direct page. Next time when an anonymous visitor will visit your site, cached file will be generated.

20 Tips and Tricks to Speed-Up Your Wordpress Blog | Image 12

As you can see this plugin is little complex to set but the results are wonderful. Install it and please share your experience with us.

About the author

Author : Pradeep Mamgain
Website : http://www.aniquito.com/
Description : We help you in understanding and taking maximum advantage of the software tools and web technologies..

We are looking for contributors

We are looking for talented bloggers, that want to promote themselves and their websites by writing articles for our blog. The topics we are interested in are : Graphic Design, Web Design, Flash, Photoshop, Vectorial Graphics, Design Inspiration, Programming, Print Design, Design Resources, photography or just “top 10 articles”. If you like the idea and want to submit an article or just want to find out more, please visit our Contributors Page.

Share this article
IzzyWebsite - CMS - The Easiest to Manage, Content Management System!
20 ResponsesLeave a comment
  • NaldzGraphics
    August 26, 2008 at 8:20 am

    great tips alex:)thanks a lot

    Ronald

    My last blog post : Create a Realistic Graffiti Text and Image on a Nice Clean Wall

  • Best Web Design
    August 26, 2008 at 2:43 pm

    Useful tips. Good job. Keep it up.

  • Thomas | Brush King
    August 26, 2008 at 6:21 pm

    Great Tips Thanks

  • Webmaster Resources
    August 29, 2008 at 3:31 pm

    Who men this article is really one of the best. Stumble for you!

    It is very simple and easy. I am gonna translate there tips for my own website because i need to say that this is a very great written article.

    Keep up the Good Work!

    My last blog post : 14 Mooi ontworpen E-commerce Websites

  • A
    September 11, 2008 at 8:53 pm

    Thats’ a great list of advise, I’ve been researching ideas on how to speed up my blog for a while now, but I never knew deleting old plugins would enhance my blog! Thanks

  • Brad Isaac
    October 2, 2008 at 2:49 am

    I really appreciate the post. I’ve noticed some major slowdowns on my site lately. Yes, traffic has been up, but I didn’t think enough to cause such a drop in speed.

    So far I’ve put in the WP-cache. My front page loads in 1.3 seconds now. Do you know if Supercache would be better?

    also, I hadn’t heard about the javascript compressor before. Looks cool!

    My last blog post : They Broke the Economy - Now What?

  • Alex
    October 2, 2008 at 11:19 am

    It seems it’s better because it doesn’t load the PHP engine to serve your pages.

  • Web Design SEO
    February 11, 2009 at 11:49 am

    Great guidence. It will help the newbies a lot. Great. Keep it up

  • Web Design
    February 19, 2009 at 11:31 pm

    I am not too much of a PHP guy. You helped me setup my first Wordpress blog.

  • Alex
    February 19, 2009 at 11:54 pm

    Glad we could help.

  • Web Designer India
    March 11, 2009 at 1:56 pm

    Too many plugins can slow down a wordpress blog.

  • Avik
    April 22, 2009 at 1:31 pm

    Thanks for the information
    It really worked

    Regards
    Avik

  • Raj
    April 28, 2009 at 10:01 am

    Awesome tips.
    Thanks a lot.

  • Flash Web Design
    April 28, 2009 at 10:02 am

    thanks for the information.

  • Brochure Design India
    April 28, 2009 at 10:03 am

    Great info.
    thanks

  • Brochure Design India
    April 28, 2009 at 10:55 am

    Great technical resource .
    thanks

  • Web Design and Web Development
    May 11, 2009 at 2:31 pm

    An excellent post….thanks for sharing.

  • Susan Libertiny
    May 28, 2009 at 3:51 am

    Excellent article. I am planning to implement some of these suggestions on my site to improve my load speed. Thanks for these great suggestions.

Add a commentGet a Gravatar

* Name

* Email Address

Website Address

You can usethese tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Sponsors
PSD to HTML
PSD to HTML
Elegant Wordpress Themes PSD to HTML
Favicon Ads
Share your design news Free Joomla Templates Free mediawiki skins Free pligg templates Flash web templates Free icons for download CLD Vectors - Free Vectors for Download Free Vectors
RSS Feed
Around The Site
Sponsor
The World's Best Web Design
RSS Latest on zaBox
Sponsors
User Links Panel
RSS User Links
  • Web Design Trend Hunting - Fluid Grid Layout: 10+ Outstanding Examples & 1 Tutorial July 3, 2009
    In our daily web hunting raids we have spotted another interesting & good-looking trend - the fluid grid-based layout
    Web Design Trend Hunting - Fluid Grid Layout: 10+ Outstanding Examples & 1 Tutorial
  • 55 Really Creative And Unique Blog Design Showcase: Inspiration July 3, 2009
    There are millions of blogs around the world, so it's really a challenge to stand out with unique design. Get inspired, to help you create really unusual design!
    55 Really Creative And Unique Blog Design Showcase: Inspiration
  • Design a wordpress theme with Photoshop July 3, 2009
    If you want to create your own custom blog design follow this easy tutorial to learn how to design a wordpress theme in Photoshop
    Design a wordpress theme with Photoshop
  • 4 Useful Random Topics For Bloggers July 3, 2009
    A roundup post for June 2009 for TutZone :)
    4 Useful Random Topics For Bloggers
  • Mark Prints for Self on Other's Blog July 3, 2009
    For a change, this post is for readers from all niche, segment, interest, community and category. Even if you have no relation with the world of web designing you shall find reading it worthy.
    Mark Prints for Self on Other's Blog
  • Web Standards July 3, 2009
    Using web standards improve the accessibility of the websites, reduce development and maintenance time, improve search engine rankings and can also improve accessibility.
    Web Standards
  • 50 Minimalist Websites Design: Best Since 2007 July 3, 2009
    Minimal Websites are interesting because it's a way to let visitors focus on the content. We just mixed the best of Minimalist design featured on CssLeak since 2007. There is 50 websites order by popularity.
    50 Minimalist Websites Design: Best Since 2007
  • HP Workstations - Prize winning video July 3, 2009
    Viral video promoting the HP workstation’s and their ability to bring peoples ideas to life.
    HP Workstations - Prize winning video
Friends
We recommend
Sponsor

Money Saving Tips
Find cheap business cards printing, postcard printing and brochure printing by searching for online coupons. Search terms like "print flyers coupon code" in your favorite search engine.