WordPress is a very popular Content Management System (CMS) that is widely used by many blogs and even websites. It has many features that make the process of editing, managing and publishing of the web content easier. One of the downsides of such a feature rich CMS is that it tends be slow in serving web content.
There are several easy things that you can do to substantially speed up WordPress blogs. WordPress also provide the ability to install and use third party plugins, which provide additional functionality and features. As with most CMS, these convenience features of WordPress comes with added server side overheads that make the website slower.
As the speed of the website is one of the important factors in SEO (search engine optimization), you should optimize your website in order to reduce the website load times. There are many different techniques used to improve the speed of websites in general, most of which applies to WordPress sites as well. We will only deal with techniques that are mostly specific to a WordPress instance in this post.
Use Caching (Any Cache Plugin)
A typical WordPress page is quite dynamic in nature. A typical request for the page includes several calls to the server, including PHP and database calls to generate the complete HTML source code (or static HTML file) that is send to the browser. Each of these calls can take up time depending on the capacity and load on the server.
A Cache saves or caches the page that is generated by the process of rendering and then (re)uses the generated page repeatedly for each of the successive requests. This means that the extra time taken to put the page together happens only the very first time/for the first visitor, and the speed is greatly improved for all the subsequent requests for the same page. It is the fastest and easiest way to improve performance of any website.
There are primarily three different caches or types of caches that you can use with WordPress sites: Database, Browser and PHP Opcode.
- Database Cache: Most of the content in WordPress is stored in the back-end database. Using a database cache with SQL optimization can vastly improve on the times when the pages make database queries. This cache basically caches the SQL query responses and thus can save on frequent database queries.
- Browser Cache: This involves caching the static files, such as images, CSS and JS files by the browser. It is quite common that much of the CSS and JS is shared between different pages in the same website.The browser can then re-use the files that it has previously downloaded rather than requesting and downloading these files again for each page request. You will need to set the file headers appropriately for these files to be cached.
- PHP Opcode Cache: This caches or saves the compiled PHP code in memory, so that the execution of the source code is faster across multiple requests.
Although each of these caching techniques requires extensive knowledge to implement correctly, there are some plugins that provide this functionality out of the box. You should definitely use one of these caching plugins in conjunction with a Content Delivery Network (CDN) to get the best performance. There are several good caching plugins available such as W3 Total Cache, WP Super Cache, Comet Cache, Hyper Cache and WP Fastest Cache.
Good Hosting Provider
Another important factor in the website performance is the DNS response times. This is most often dependent on the server that is hosting the site. That means it is dependent on the hosting provider. It also depends on what kind of server is used…there are usually three different flavours: Shared, VPS or Dedicated.
Using a good hosting provider with a good reputation for fast speeds is a good idea. There are possibly two important things you should look for (apart from the price, of course) in a hosting provider: Out of the box support for WordPress with regular updates and fast DNS response times. I am not going to endorse any providers, as these change constantly but you can find some recommendations from the WordPress site.
Use a Content Delivery Network (CDN)
Content Delivery Networks or CDNs are usually a large network of servers located in different geographical regions that caches and serves content from your website on your behalf. These servers caches the static content on your websites and serves them to the user. This reduces the load on your server and also reduces the download time because by geographical proximity.
This increases the availability and performance of the websites several fold. There are several free CDNs that are available, such as Cloudflare, Coral CDN and Photon that you can use. If you have a website with a large amount of traffic then investing in one of the paid CDNs would be worthwhile.
Minimize Plugin Usage
Some plugins are inevitable when running WordPress sites, such the caching plugin mentioned above. Most times, plugins tend to slow your websites down especially if it is poorly coded.
It is a good rule of thumb to install and use only plugins that are crucial to the website. Go over each of the plugin that you use on your site, and evaluate the necessity of the plugin to your website. Remove the plugins that you do not need.
It is also a good idea to completely remove any unused plugins, rather than leaving them deactivated. Your priority should be to speed up WordPress blog, rather than to add nice-to-have features.
It is always a good idea to clean up the database occasionally. A smaller database performs better and faster to queries. There are again several plugins that helps you maintain the backend WordPress database.
These plugins often allow you to optimize and repair databases. They can cleanup temporary and unnecessary files and reduce the overall size of the database tables. WP-DBManager, WP Optimize and Advanced Database Cleaner are some of the popular plugins.
Manage and Delete Revisions
A big culprit in the ever increasing size of the databases, is the revisions of posts. Every time you perform a save while writing or editing a post, the system creates a new revision of the post. It works as a backup of the post. This is really useful if and when you want to revoke any changes that you accidentally made. It is also a good mechanism against accidental deletions and browser crashes.
However once you are done with publishing the post, there is usually no reason to keep the many revisions around. Most of the database plugins that does cleanup also provide you the option to cleanup revisions of posts and pages.
Clean up Spam Comments
Again this is along the lines of deleting revisions of posts as previously described in the section above. There is no reason to keep spam comments, which just adds to the bulk of the database. Again you should be able to use a database plugin such as WP Database Cleaner to clean up your comments.
No Ping-backs and Trackbacks
Ping-backs and trackbacks are features of the WordPress frameworks, that allow you to keep track of the links and back-links. You can reciprocate by creating a link from the post to the webpage that generated a link to your post.
Pingbacks and Trackbacks are also one of the mostly widely abused features and mostly creates tons of spam links. You can easily disable track-backs and ping-backs right from the blog edit screen.
Use Content Excerpts
Many websites and WordPress themes show the entire blog post in the Home and Archive pages. While some times this is useful and desirable, it is usually unnecessary as the user can click and view the content in the post page. Unless it is absolutely necessary, you should only display a small excerpt of the post content in the archive pages.
Choose a Fast Theme
You need a WordPress theme to create a WordPress blog or website. This provides the necessary tools to display the content in addition to determining the look and feel of the website. Always keep the importance of speed in mind when choosing a theme.
The main problem with most third party themes is actually the abundance of features, rather than the lack of it. Most of these themes are created with a wide range of users in mind, which means it will include features that you might never end up using. These will just add to the clutter and has the potential to impact the speed of the website.
The best option you have is to create a custom theme that is geared towards exactly what you need and want. This keeps the clutter to a minimum and allows you to optimize the speed. Unless you have some programming skills, creating a theme can be pretty daunting. Getting a WordPress professional to create custom theme is always an option, but could well be a pricey option.
Follow Generic SEO rules
Although we dealt mostly with SEO features that are more or less specific to the WordPress framework, it is always prudent to also follow the generic SEO rules that are applicable to all websites. You read up on other generic rules of SEO and use them to speed up WordPress sites as well.