Help! Pages on my website are taking 20+ seconds to load

Problem description
  • Your website is normally very fast to load, but suddenly or recently it takes 20+ seconds to load a single page (which could result in an error at the end, or the page loading normally).
  • Your website is loading slowly.
  • WordPress is slow.
This could mean:
  1. Your web host is under heavy load. If this is true, then simply wait it out for 10-30 minutes and check the results again later.
  2. You're using an old version of PHP
  3. Some unknown resource on your website is loading for as long as the PHP process is allowed to live, then failing either silently or with an error

The first issue is pretty common and should be expected (to a certain degree) under shared web hosting environments. If you have a dedicated server, I'd suggest getting in touch with whomever is manging your server to find out why there is/was a temporary slowdown.

The second issue can be remedied pretty easily within Plesk; see our guide here to changing the PHP version.

The third issue needs a bit of sleuthing. There's two ways to go about finding the source of this problem: exhaustive and a specific search. You may find that the specific search fails, in which case you'll have to fall back to exhaustive.

Specific Search Problem Solving with WordPress

This is a tad more difficult, but often when there are issues with a plugin or theme, after the page finally loads, you can inspect the page for glitches or missing elements. For example if the problem is with a Twitter widget, you might find that the Twitter widget never loads on the page like it should. Then you can go specifically to that plugin and disable it to solve the problem without having to scan through each of your plugins one-by-one.

If you are unable to spot any glitches, you'll have to fall back to the exhaustive search option below.

Exhaustive Search Problem Solving with WordPress

To troubleshoot this exhaustively (and you'll soon realize why it's called that), simply disable each plugin that's active on your site one-by-one until the site begins loading normally again. The last plugin to be disabled will be the source of the problem. You can then re-enable all other plugins and request help from the plugin developer.

If you are unable to access the WordPress admin area, you can disable the plugin by renaming its folder using the Plesk File Manager.

You may also find you need to activate another theme, even if just temporarily, to figure out if the theme code is to blame. If changing themes fixes the problem, then you should request help from the theme developer.

Why did my plugin or theme behave this way?

There's usually only two causes:

  1. Some updated code in the plugin or theme causes a spinlock -- basically a loop in the code where it's endlessly processing and never coming up with a result.
  2. Something in the plugin is trying to access resources that are blocked or unavailable and doesn't have a sane timeout value set (such as 5 seconds max load time). Examples:
    1. The software is trying to open a port that is blocked. This occurs when trying to communicate with a payment processor or other third party service.
    2. The software is trying to communicate with a server that is unavailable. This has occurred in the past when services that are expected to always be operational are down, like when Twitter goes offline for a few hours and your site is attempting to load your Twitter feed.
To prevent this from occurring again, you will need to reach out to the plugin developer and indicate to them what happened. If the issue was #2, then you should then suggest that they include a more reasonable timeout value in their code and/or better error correction. If the issue was #1, they'll have to investigate further to find the source of the problem.
  • 0 Users Found This Useful