WordPress is the most popular platform for websites out there. The content management system is installed on thousands of websites and nearly as many environments.
But you may have noticed your website running slowly, which is a fairly common problem.
How quickly your website loads is important. People will leave if it takes too long and a slow-loading website also affect your Google ranking. John Mu at Google tweeted a while back and recommended a load time of less than two or three seconds.
Too often, I see people simply slap a caching plugin onto their WordPress installation. That’s not actually solving the problem, you’re just putting a bandage on it.
Let’s take a look at some of the common issues that cause WordPress websites to load slowly.
A bad theme
If your theme is put together poorly or has too many features, it can cause slow load times. The resulting website may look great, but it could have any number of problems.
Specifically, you could end up with files that are too big or too many of the following items:
- CSS files
- PHP files
If any of those are too big or there are too many of them, it can greatly affect your website’s loading speed.
How do you avoid this issue? Pick a theme or theme framework with a reputation for being lightweight. Do your research ahead of time and see what people are saying about the load time, code bloat, and whether it’s lightweight or not.
Too many plugins
Too many plugins—even if they’re not activated—can cause the same issues as a bad theme, but on a larger scale. When it comes to themes, there’s one active theme per website. Most WordPress websites have a number of plugins.
And if they’re poorly written, the problem is even worse!
There’s no hard and fast rule on how many plugins you should have. However, I’ve found a good guideline is to keep it in the single digits. If you have a background in PHP programming and can actually evaluate how well a plugin is written, ten to fifteen is probably okay.
In general, I advise avoiding all-in-one plugins. With the possible exception of Automattic’s own Jetpack plugin, all-in-one plugins can cause issues as well. One plugin with the functionality of 100 plugins is nearly as bad as just installing 100 plugins.
Deactivated plugins can still cause issues, so be sure to delete any you aren’t using.
Both an image’s dimensions and its file size matter when it comes to loading time in WordPress. Your theme, plugins, or content itself may have images that are far larger than they need to be.
First, be sure to resize your images before you upload them using image editing software like Photoshop. The guideline I currently use is no bigger than 1200 pixels wide.
Second, save them as the right file type. A photograph should be saved as a JPG, not PNG. An image that’s an illustration with a lot of solid colors—not gradients—should be saved as a PNG, not a JPG.
Of course, all these tips are useless if you have horrible hosting. To test that out, you can use a tool like Bitcatcha.
Even without testing, you might just remember the old saying, “You get what you pay for.” If you’re only paying a couple dollars a month or especially a year, you probably have bad hosting!
Once you’ve taken care of all these issues, adding a caching plugin can still help. However, avoid the trap of installing it without actually troubleshooting the issue first. Otherwise you may end up causing other problems and frustration down the road.