How to Optimize Your WordPress Blog for Performance


WordPress is an excellent blogging/news website platform as a whole, but has been criticized for being a bit of a performance dog. One of my websites which is powered by WordPress receives between 100,000 and 200,000 unique visitors a month. I’ve gotten a few nasty emails from the two hosts that I’ve had the site on during the last year for taking up too much of the shared server’s CPU usage. Fortunately the poor performance of the base WordPress installation can be mitigated with a few different performance optimization plug-ins and techniques.

Here are a few things that I’ve done to get my WordPress installations’ performance in check:

Minimize Plug-In Usage - Many WordPress users, including myself, have the bad habit of running 20 to 30 different WordPress plug-ins at once. Each plug-in that you have installed adds to the amount of work that the server needs to do to load pages on your website. Keep the number of WordPress plug-ins that you have installed to a minimum.

One of the Plug-Ins that has been considered a “worst offender” is the popular All-In-One SEO Plug-in, so much so that DreamHost has banned its users from using the plug-in. Some would dispute the claim that it’s a performance nightmare, however you are probably better off to build your SEO optimizations into the template itself rather than using a third-party plug-in.

Word Press Super Cache Super Cache is a plug-in that creates static HTML files which will load for your users instead of dynamically generating post HTML on each page load. Almost all Columbus Ohio web designers use this. This plug-in is a great help for sites that get featured on social bookmarking sites or have a few popular articles that get hammered.

Super Cache also supports a more traditional caching method (the one that came with the “WP Cache” plugin) for servers which do not support Super Cache. The downside to the “cache” method is that it does require loading a PHP script, whereas the “super cache” method requires nothing in terms of executing server-side scripts on a cached page load.

Word Press Object Cache – WordPress has a built in object cache which was added in version 2.5. The “Object Cache” will cache the results of different database queries that WordPress makes. For example, when any of the pages on your site loads, it will need to populate the site’s blog-roll and any widgets from the database. By enabling the object cache, you can cache the results from queries, minimizing the amount of database queries that WordPress needs to make.

To enable the WordPress object cache on yours site, edit your WP.Config file and add “define(ENABLE_CACHE, true);” to your list of “defines”. This may be added by default to later versions of WordPress.

To read more about the Object Cache, read this article on NeoSmart.NET.

Optimize Your PHP.INI File – Optimizing your PHP configuration file can improve the performance of your site. ElliotBack.com has some suggestions about what changes you might want to make to your configuration file, which will disable some modules which may not be needed for your website. He also offers a link to this more complete guide to optimizing your PHP.INI File.

Use a PHP Compiler Cache – You can make use of a PHP Compiler cache which will save scripts in a compiled format so they are not being recompiled each time they’re called from a page load on WordPress. The compiler cache will save your PHP scripts, including your WordPress files in a compiled state, eliminating the overhead caused by the compilation of your PHP files. Two popular PHP compilers are  APC & eAccelerator that you may want to investigate, but it’s probably not worth it to go through the process of using these tools unless you have an extremely high traffic website.

Choose a Good Web Host – This won’t make your WordPress install run any faster, but choosing the right host from the get-go can minimize the need to spend a lot of time tweaking your site’s performance. Not all host are the same. Most hosts will shove you on a shared server with dozens of other websites, which isn’t a bad thing, because shared hosting allows you to get web hosting for much less than you would have had to if you bought your own web-server. The difference lies in how many websites a host will try to shove onto a single server.

Before choosing a web-host, search for the name of the host followed by “WordPress issues” or “Wordpress Problems” to see if current customers of the host are having performance issues with their WordPress sites.

Hardcode Values in Your Template – By default WordPress values use PHP functions on each page load to calculate the server path of where your template files are. Digging into WordPress suggests that you should replace these with hard-coded values to improve performance. We’re not sure how much of a benefit using hard-coded values will provide and probably isn’t necessary for smaller sites, but will probably provide some sort of assistance for sites with substantial traffic levels.

MySQL Database Optimization with PHPMyAdmin - Your web host probably provides you PHPMyAdmin access, which will allow you to run a built in optimization function on your tables. Weblog Tools suggests that going through the process will  provide a nice performance boost. EarnersBlog.com agrees that it’s also worth doing. It’s probably worth trying, but make sure to back up your database first.

Conclusion

More often than not, installing Super Cache and getting rid of un-necessary plug-ins will be more than enough to make 95% of sites run at more than acceptable performance levels. If you’ve got a large site, as in that you are receiving hundreds of thousands of unique visitors each month, then it probably makes sense to start looking at some of the other optimizations suggested in this article.

How to Save Money on Car Insurance

Everyone is searching around for ways to save more money. Statistics show that drivers pick a car insurance company and remain loyal to them for years. However, remaining loyal doesn’t mean that the car insurance policy will become more affordable over time. When people become more passionate about trimming monthly expenses, they may start by … Continue reading

How to Ensure You Will Actually Get Paid as a Freelancer

As unemployment rates remain elevated in most developed countries, people with specific marketable skill sets, such as website development, graphic design and copy writing, have been applying those talents in the marketplace in the form of freelance work to supplement their income streams. As a person that has done a lot of freelancing work in … Continue reading

The Importance Of Spending Time On Your Car

To some people, a car is simply a vessel for daily transportation of both people and objects. However, while this is part of what comes with car ownership, if the owner does not spend any time maintaining their car, they will run into problems. What are the benefits of spending time working on a car? … Continue reading

How to Make Use of Namespaces in C# and Visual Basic .NET

If you’ve written any sort of software application of decent size, you’ll know that you need to structure your code, most often using object oriented design techniques, to keep your code-base manageable. Some languages such as Java and C# enable developers to write object-oriented applications relatively well out of the box without much extra work. … Continue reading

Arvixe’s Customer Service Has Won Me Over

For years, I had been a DreamHost customer. I had their standard shared reseller hosting account that costs peanuts. Every few weeks my sites would crash hard when they had any remote amount of significant traffic. Eventually it got to the point where I was losing out on ad-revenue because of DreamHost’s inability to keep … Continue reading

Facebook Goes Live with Bookmark Prompt

A couple of months ago, Facebook announced some ambitious changes to their API. We’re now starting to see some of the first of the newly announced features be released into the wild. A couple of weeks ago, Facebook added the ability for developers to ask prompt to bookmark their application. Previously, users were only able … Continue reading

How to Build a Code Igniter Development and Testing Environment on Windows

I’ve been playing around with the Code Igniter Framework for PHP over the last couple of weeks, primarily because Net Tuts has a series of 6 high-quality screencasts showing off some basic functionality of the framework. Essentially, Code Igniter provides some additional functionality and provides a standardized means of creating pages and methods using the … Continue reading

How to Post to Facebook’s “Stream” using Facebook Connect and XFBML

For my day job, I’ve been developing a facebook application to coincide with its annual SpayDay event. Developing the application has caused several headaches, but once I realized that the majority of the facebook integration wouldn’t happen from the Facebook Developer Toolkit (an ASP.NET Facebook Development Framework), and instead from JavaScript-based XFBML, life got a … Continue reading

Fast and Efficient C# and Visual Basic String Concatenation

If you do any sort of web development work on the .NET platform, you are going to find yourself concatenating (connecting) strings together on a very regular basis. There are two ways to do this. The first is with a traditional string concatenation, which would look something like this: string MyString = String.Empty; MyString = … Continue reading