So, you have a Wordpress site because, well, your smart SEO guy told you it was the best to have. What this really means is that it’s the platform he/she knows how to use, but that’s another article. Now you’re wondering, “Why is my site so slow?”
Some may retort, “Because it’s Wordpress and it sucks!” But, this isn’t helpful to you, and regardless of what some believe about Wordpress, many of the page speed problems you’re probably seeing are common in other CMS systems, as well as custom programmed websites. So, while the thoughts below are written with Wordpress in mind, you can apply many of the ideas to almost any website that’s running slower than you’d like.
The first step is to find out what the problems actually are. There are a few good tools available for analyzing your page speed, but my favorites are:
Google PageSpeed Insights - https://developers.google.com/speed/pagespeed/insights/ GTMetrix - https://gtmetrix.com/
Both of these will give you a good indication of where the bottlenecks are occurring, as well as some valuable information on how to correct the problems. Of course, if you don’t manage your site and/or hosting account, you’ll be at someone else’s mercy to help with some of the problems we’ll discuss. So, let’s just run through a few things that are common problems, which you may see in your analysis:
If at all possible, these file references should be moved to the bottom of the HTML document. If you’re using a theme and plugins that are inserting the JS at the top, perhaps sending a message to the designer or developer asking for assistance will help. Probably not, though, so you may have to hack the theme yourself or ask for assistance from another developer. WPCurve.com is a great source for Wordpress help like this.
Low cost hosting often gets a bad rep. But, sometimes it’s warranted. A Wordpress site can be a fairly good load on a server, and using the $3/month shared hosting account, which promises “unlimited everything” is probably not your best bet. The tools mentioned above will give you an indication if the server response time is part of your problem. If it is, and you’re on a cheap hosting account, sending them nasty emails isn’t going to fix your problem.
I’ve had very good luck with using cloud servers or VPS’s from Rackspace and Digital Ocean. There are other hosting providers who specialize in Wordpress sites, and they vary in price and performance. Perhaps a good review of some of these will come in a future article. However, if most of the add on features these hosting sites provide can be duplicated by using CloudFlare in front of your VPS. We’ve had very good experience running Wordpress sites on a Rackspace Cloud Server and routing the traffic through CloudFlare. Shoot us a message if you’d like more information on how to set this up.
Other things to think about regarding your hosting environment are to make sure Keep Alive and compression are enabled, as well as some other server setting that can ensure the pages are served efficiently. I’ll try to write a more in-depth server configuration and optimization article in the coming months. But, for most small sites with lighter loads, the default settings for most hosting environments will not cause a bottleneck at this level.
Wordpress, and other Open Source CMS systems are popular because of the large community of developers that build plugins, extending the basic features of the CMS to create robust web applications, in some instances. However, with this popularity comes a community of, let’s just say, less than desirable developers, who build plugins that cause less than desirable results on your site.
There are several sources of “the worst Wordpress plugins,” but much of that information is subjective, outdated, or just not useful. I’d recommend doing the following:
- Remove any plugins you aren’t using
- Disable all other plugins
- Enable each plugin one at a time and test the site speed.
- If you find a plugin causes a large increase in page load time, remove it and search for an alternative.
Beyond that, the best way to evaluate what plugin is causing problems is by viewing the transaction logs in a service like New Relic or Xhprof. The use of these tools is beyond the scope of this article, but feel free to contact us for further information or assistance with one of these advanced analytic tools.
If you have 20 images on your home page, every time someone visits your page, the browser has to make 20 calls to the server just to retrieve those images. Browsers are often fair at caching these static assets so that a local copy can be used instead of making all of those requests. However, to improve efficiency of browser caching, there are many Wordpress caching plugins available. Not only do these plugins help control how browsers manage client-side caching, but many have features which allow you to control database caching, and other server-side functions. Be sure and research these, as many of them fall under the “Bad Plugins” section mentioned above.
WP Super Cache is one of the most popular, and fairly robust. Some of the features should be tested with your site before just turning them on and ignoring things, as I’ve found that some CSS and JS aren’t compatible with the concatenation and minification functions available with this plugin. For a nice article regarding this and other plugins, check out this article from SitePoint.com.
If you’ve had your website custom programmed, ask the developer for help on setting up database query caching and other features that will speed your site up tremendously, especially if you have a high traffic site with lots of dynamic content.
To reduce content size, follow some of these guidelines:
- Try to optimize images and reduce their size to the smallest that still look good in the browser.
- Concatenate and minify remaining JS and CSS. Use tools like CodeKit to combine the JS files and CSS files so that the overall size and number or required server requests is reduced.
- If you have a video or large image background, it’s likely you can reduce the resolution, and therefore the file size, of that file without a noticeable difference. This is especially true when the background has an overlay on it, which is often the case in landing page slideshows and such.
- Minify your HTML. This is likely overkill, and will give you minimal improvement. Personally, I don’t believe the advantages in speed make up for the difficulties you create in maintenance and updates of the site, but some will recommend it.
There are many other tricks of the trade, all with varying degrees of results. But, I’ve found the items mentioned above should give you a good start on improving the speed of your site. If you need assistance or have any questions, feel free to drop us a line. We’re always here to help.