Skip to content

9 Ways to Create a Crash Proof WordPress Site

As your blog starts to grow, inevitably you’ll get one big spike of traffic and your site will go down. Rubbish. This post has nine ways to combat that and create a ‘crash proof’ WordPress blog.

crash-proof-large

1. W3 Total Cache

Used here on WPShout:

Trusted by many popular blogs like: mashable.com, pearsonified.com, webdesignerdepot.com, freelanceswitch.com, davidbhayes.com, css3.info, tutsplus.com, yoast.com, noupe.com and others — W3 Total Cache improves the user experience of your blog by caching every aspect of your site, reducing the download time of your theme and providing transparent content delivery network (CDN) integration.

It’s a great caching platform that creates static versions of your pages. And a heck of a lot more!

W3 Total Cache

2. WP Super Cache

The caching plugin that everyone uses (at least until W3 Total Cache came along!). I’m no expert, but W3 Total Cache and WP Super Cache are pretty similar – they’re both caching plugins. However, to me at least, it looks as though Total Cache is a tad more superior with a couple of additional features. That said, they’re both excellent plugins and the only way to pick between them is to try them both out! So do that!

A classic method of preparing an under powered site for a Digg front page appearance or a Slashdotting has been to manually save copies of dynamically generated pages, and place them in directories that match the permalinks structure. This method of performance enhancement does help servers handle a higher load without crashing, but is only effective when an oncoming rush of traffic can be anticipated. WP-Cache alone, while helpful, is not adequate in many cases, so WP Super Cache was created to effectively mimic the manual page caching method, but to handle it in an automated fashion.

Just to prove it works, check out FrozenToothpaste.com – it’s using a standard layout of featured post and then recent posts below. With Super Cache turned on, it’s loading just over a second!

WP Super Cache

3. Caching with .htaccess!

As I wrote a while ago, it’s really easy to cache your files with the .htaccess file – the following code can just be plopped into your .htaccess file:

# BEGIN Expire headers

  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType text/html "access plus 600 seconds"
  ExpiresByType application/xhtml+xml "access plus 600 seconds"

# END Expire headers

Source.

4. Reduce database queries

This is a killer one. Reducing the number of database queries your theme is making can be the difference between your site staying up and going down! You can easily check how many queries your theme is using with the following:

<?php if (is_user_logged_in()) { ?>
    <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
<?php } ?>

Counters are great for reducing your queries – look at Binary Moon‘s sidebar to see an example of how counters can be used to pull a load of data in a single loop.

It’s all very easy seeing how many database queries you’re making, but reducing them? That’s the interesting bit. The culprit can often be plugins – the YARPP plugin makes a heck of a lot of queries (often 10+!) and whilst it’s incredibly customisable, it could well be slowing down your site a heck of a lot. Just bear that in mind.

The next thing on the list is custom fields. WPShout is using custom fields on the homepage in order to grab a featured image. Getting rid of those images took the count down three queries so that’s something to bear in mind when creating a magazine theme.

Custom loops are a massive culprit too with even the simple downloads section on WPShout using five queries! With something like that with relatively static content, it can be an idea to comment out the query and replace with the static code generated (ie copying and pasting from the source code).

5. Utilise your .htaccess file

We’ve already touched on .htaccess in this article, but there is a heck of a lot more you can do with it – check out “10 Ways to Use .htaccess to Speed Up WordPress” for more tips – you can easily cache, gzip, stop hotlinking, the lot!

6. Take the load off your server

An interesting one this that I’ve been experimenting a bit with recently. The idea? Use a service such as Amazon S3 to host your images, CSS and JS, making your site load quicker and taking some of the load off your server.

In practice, using Amazon S3 day to day is a little more challenging. However, with a plugin such as “Amazon S3 for WordPress” it’s fairly easy to use S3 to host all of your media files.

7. Clean up that database!

As I explain in this post, it’s very easy to optimise your database – login to cPanel and then load up phpMyAdmin. Next, select the database WordPress is installed on and then ‘Check all’ checkboxes. Then on the dropdown at the bottom of the page click ‘Optimize table’ and you’re done!

8. Get a decent host!

This one’s uber important. Without a good host, a spike of traffic will see your site plummet out of the interweb. A decent host should be an integral part of your blog’s strategy. Yes, they will cost more, but you’ll not regret it when your site gets popular on Twitter and the site remains up.

9. Your thoughts

I haven’t done this for a while, so here goes. Why not suggest your way of optimising your theme. Leave a comment below (RSS readers jump to the comment form here)!

Alex Denning

7 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Brannon Smith
March 10, 2011 2:30 am

My site was down, version 3.1, and I took your database optimization advice and the site came right up. Thanks for the info.

Fabrizio Van Marciano
February 7, 2011 5:05 pm

Brilliant and most resourceful post. One of my blogs recently went down due to a plugin error, its definitely worth investing the time in getting your database optimised and I’ve only just started using wp super cache.

Twitter Link Roundup (10.25 – 10.31)
November 1, 2009 9:43 pm

[…] 75 PSD to HTML Resources for Web Designers Four Different Ways of Implementing Twitter on your Site 9 Ways to Create a Crash Proof WordPress Site Export All Your Google Docs to a ZIP File Blog Promotion: 169 New Ways to Build Traffic Like a […]

Il meglio della settimana #36 | BigThink
October 31, 2009 10:08 am

[…] 9 Ways to create a crash proof WordPress site Plugin e tecniche per ridurre il carico di lavoro (RAM e CPU) del nostro blog WordPress ed evitare il crash. […]

swapna
October 27, 2009 6:34 am

Ohh Great fund as!!

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!

Most Searched Articles

Best JavaScript Libraries and Frameworks: Try These 14 in 2024

In this post, we look at the best JavaScript libraries and frameworks to try out this year. Why? Well, with JavaScript being available in every web browser, this makes it the most accessible programming language of ...

25 Best Free WordPress Themes (Responsive, Mobile-Ready, Beautiful)

If you're looking for only the best free WordPress themes in the market for this year, then you're in the right place. We have more than enough such themes for you right ...

12 Best WordPress Hosting Providers of 2024 Compared and Tested

Looking for the best WordPress hosting that you can actually afford? We did the testing for you. Here are 10+ best hosts on the market ...

Handpicked Articles

How to Make a WordPress Website: Ultimate Guide for All Users – Beginners, Intermediate, Advanced

Many people wonder how to make a WordPress website. They’ve heard about WordPress, its incredible popularity, excellent features and designs, and now they want to join the pack and build a WordPress website of their own. So, where does one get ...

How to Start an Ecommerce Business: Ultimate Guide for 2024

Is this going to be the year you learn how to start an eCommerce business from scratch? You’re certainly in the right place! This guide will give you a roadmap to getting from 0 to a fully functional eCommerce business. ...