Why is my WordPress site slow?

When you're asking yourself "Why is my WordPress site so slow?" things can be confusing because there are a huge number of possible answers. It could be because of your hosting, your site or it could just be you. Let's explore.

Is it just me?

Is my computer older?

If you have a demanding site or one heavy on javascript, it might just take a while to run on an older computer. Try testing on a newer computer if you think that might be the issue.

Is it my browser?

Take a moment to make sure that you're running the latest version of your browser. If you're running Internet Explorer, please please please switch to something better. Chrome, Firefox and Opera all have more features, better support for those features and they're faster. Take a moment to switch and you'll notice your internet experience is faster and prettier. Go ahead. I'll wait. So, now that we're all using the latest version of our favorite browser, try clearing your cache and cookies just to make sure there's nothing lingering in there to slow you down.

Is it my internet connection?

You might just have a slow or faulty connection to the internet. Make sure your local router is properly configured and that you have a good connection to it. Then check out SpeedTest to see how fast your connection is in general. If you have a ping that's closer to a second than it is to zero, that's a problem. If your download speed is less than 1Mbps, it's very probably you. Note, that even if you have a fast connection, it could still be the network you're on. It takes me almost 10 seconds to connect to some of my favorite sites from work because we're on the RoadRunner network and they're terrible.

Is it my website host?

If you don't have properly configured hosting it could be slowing down your site. Do you know where your site is hosted? If it's far away from where your users are your site will seem slow just because the information has to travel so far. See if you can move your site to a datacenter closer to you. Are you on a budget webhost? They might just be putting your site on their crappy old servers because you're not paying them enough. Here's a really good one: Are you on a shared hosting plan? It might be the case that you're sharing a server with other people and other websites. Your site might be blazing fast but when it's competing for resources with 200 other sites it's hard to be speedy. Consider switching to a plan with a virtual private server or even your own server entirely if you need it. Is your site really popular? If you don't already have it, get JetPack for WordPress and install it. JetPack's stats are a really easy way to know just how much traffic your site is getting and you don't have to go to another website to see the numbers. If your site is very popular, all that traffic might just be bogging down your servers and you need to move to hosting with more resources.

If you find that your hosting is the problem, I strongly recommend you switch to WP Engine. They're who I use for hosting my website and all my clients websites. They offer a free CDN, support from people who do WordPress all day long and a list of included features and services that most other hosts charge a lot of money for(Especially the CDN. Even for my little site, a CDN might cost 40$/month and they just include it for free.). The best part for my clients is that it's all managed hosting so you don't have to deal with servers or configuration or network maintenance. They handle all of that and optimize everything for WordPress specifically. They also have amazing security and will automatically upgrade your site to the latest version of WordPress when it comes out. I know I plug these guys all the time but they're seriously the best and they make me really happy.

"Why is my WordPress site slow?"

If it's not you, the network or your hosting, it's definitely your site. Let's start with the easy ones:

Too many plugins - Each plugin adds stuff your server has to do before the page loads. Turn off and delete plugins you don't use and see if you can cut down on ones you don't really need.

Too many / huge images or video - If your site is very media-heavy that is probably what's slowing it down. If there are a ton of images or video on every page, try to cut down on that. If all of the images are necessary, it's time to get skinny. Download ImageOptim and start using it. This cute little program strips out all the extra stuff in your pictures without making them smaller or lower quality so they load as fast as possible. If you're serving video, consider switching to a service like Vimeo or VideoPress so they can handle the bulk of that.

Too many external scripts - If you're using a ton of external services on one page, things are gonna get slow. These are things like adding facebook, twitter, linkedin, spotify, pinterest, addthis, vimeo, adsense, analytics and all sorts of other services. Each one of these services slows down your site just a little bit. If you integrate with a lot of them, consider trying to find a more elegant way to get your social media and analytics on the page or just drop the ones you don't really need. Use a tool like yslow is a really good idea. It takes a look at your site and breaks down things you could do to improve in a very understandable way and then gives your site a letter grade. I use it all the time.

Too many database queries - This one's a bit techy. WordPress generally makes about 4 queries to the database to retrieve your posts/pages each time you load a page. If your site's theme has a lot of extra queries to the database, this can significantly slow your site. Try using the Theme-Check or Developer plugins to gain a little more insight into what's going on behind the scenes so you can clean up your site's code. Lots of related-posts plugins will slow down your database and so will things like showing 4 different categories of posts on one page. Try to minimize your queries as much as possible. If this is all over your head, email me for a consultation and we'll see what's going on.

Optimization

If you're still looking to make your site faster there's a couple things you can do to really speed things up.

Content Distribution Networks

First thing to do is start using a Content Distribution Network to serve all your static files and image(WP Engine includes a CDN for free). A CDN serves all those files for you instead of from your server. They do this from multiple locations around the world to make sure that your images and static files get to your users from a high-speed and nearby location. This takes a lot of load off of your website's server and makes your images seem like they load magically fast. If your webhost doesn't offer their own CDN, consider using MaxCDN. It's basically the same thing as NetDNA which is really good.

Compression

A lot of the files your server sends to your users can be made smaller so they send faster. If your server isn't already using gzip compression, turn that on. Gzip compression could save you tons of bandwidth and lots of money every month. MINIFY EVERYTHING. If it's a thing, it can be made smaller. Go through your site's theme and minify all the CSS and javascript files. I use CodeKit to keep track of all my web projects. It has CSS and javascript minifying built in and does it automatically. I strongly recommend it. If you have a popular site and minify those files, it could save you hundreds or thousands in bandwidth costs every year. Plus it will make your site a bit faster. If you're using images for design purposes, stop it. You can do almost anything with well written CSS and another 30 lines of CSS is way smaller than even one little image.

Mobile

It doesn't always seem like it but your phone or tablet doesn't have that much processing power compared to your larger computers. Plus when it's just connected to the cellular towers and not Wifi, it is on a very very slow network. For that reason, try to strip out all the extra stuff on your site when serving mobile devices. Take out unnecessary images, keep the design simple and try not to run too much javascript and definitely no Flash. I would recommend using JetPack's mobile theme. It's a theme specifically designed for mobile users. It takes one click to set up and looks decent.

Site still running slow?

Leave a message if your site is still running slow after you've gone through this article. Or especially let me know if you can think of another good way to speed up your WordPress site.