Diagnosing a suddenly slow WordPress site

How to find and fix the cause of sudden WordPress performance problems by profiling slow queries, auditing plugins, optimising the database, configuring caching and checking hosting resources.

A WordPress site that was quick yesterday but sluggish today usually has a specific cause you can track down. Something changed: a plugin update, some new code, a traffic spike, a database that's grown too large or a problem on your hosting provider's side.

That's different from a site that has always been slow, which is usually a broader optimisation job. When performance drops suddenly, the aim is to find what changed rather than applying general speed tweaks blindly.

Rule out server and hosting problems

Before looking at WordPress, check whether the problem is at your hosting provider. Look at their status page for outages, maintenance or known issues.

Test your site's response time with an online speed testing tool, ideally from more than one location. The figure to look at is Time To First Byte (TTFB), which measures how long the server takes to start sending a response. If it's high on every page you test, the bottleneck is probably on the server rather than in the page's images or scripts.

Also try a private or incognito window. If the site is fast there, the slowness may be down to your browser, its cache or an extension, rather than the site.

If TTFB is high, ask your hosting provider whether anything has changed on the server recently, such as heavier load from other sites on shared hosting, a configuration change or your account being limited for using too many resources. If the slowness has turned into 502, 503 or 504 errors, see our guide to fixing those, which also covers spotting bot traffic.

Measure what's slow

The quickest way to find the cause is to measure what's taking the time.

The Query Monitor plugin shows the database queries, outside requests and PHP errors behind each page, how long each takes and which plugin or theme is responsible. That usually narrows things down quickly. It's aimed at developers but the key figures are easy to read. Deactivate and delete it when you've finished, since it adds overhead of its own.

WordPress's debug log can also help, by recording PHP errors and warnings that may point at a misbehaving plugin. Download a copy of wp-config.php before editing it, since a typo in that file can take the whole site offline. Then add:1

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Errors are written to wp-content/debug.log. When you've finished, remove these lines and delete the log, since it can reveal details about your site and server.

Review your plugins and theme

Plugins are the most common cause of sudden slowdowns, particularly after updates. An update can add a feature that runs extra database queries, or a bug that makes something run far longer than it should.

Check whether the slowdown started around the time of an update. Performance problems are often fixed in a later release, so check whether a newer version is available, and take a backup before updating (testing on a staging copy if you can). Then look at your active plugins and remove anything you no longer use, taking a backup first since deleting a plugin can also delete its settings and data.

Look out for plugins that do the same job. Running several caching, SEO or security plugins at once can cause conflicts and slowdowns as they duplicate work.

To test whether your theme is the cause, switch temporarily to a default WordPress theme and compare. Themes with lots of built-in features, page builders and sliders can add a lot of work to every page load. Switching theme changes how the site looks to visitors, so do this on a staging copy or at a quiet time, and switch back afterwards.

Check your PHP version

The version of PHP running on your server affects both speed and security. WordPress currently recommends PHP 8.3 or newer,2 and newer PHP versions are generally faster than older ones. You can see your version under Tools → Site Health → Info → Server or in your hosting control panel.

Changing PHP version is done in your hosting control panel or by your host, and it can break plugins or themes that aren't compatible. Before switching, take a backup, check your plugins and theme support the new version, test on a staging copy if possible and note your current version so you (or your host) can switch back if the site shows a critical error. Plugins that are no longer maintained are the usual problem, and our guide to dealing with closed or abandoned plugins covers replacing them.

Check caching is working

Without caching, every page view makes WordPress run PHP, query the database and build the page from scratch. Caching stores the result so later visits don't have to repeat the work.3

  • Page caching stores finished pages so they can be sent to visitors without running WordPress at all. For most sites it makes the biggest difference. Many hosts include it, or it can be added with a caching plugin.
  • Object caching stores the results of database queries in fast memory (using a system such as Redis or Memcached), which helps pages that can't be fully page cached, such as shop baskets and logged-in areas. Many managed WordPress hosts include it.
  • A CDN (content delivery network) serves images, stylesheets and scripts from servers around the world, closer to your visitors.

If your site had caching and it's suddenly slow, check the cache is still working. A plugin update, a settings change or a conflict can switch it off without you noticing. Our guide to a WordPress site not updating explains how the layers fit together. If you're changing caching settings, note the current settings first, and test the site afterwards, particularly forms, logins and any shop.

Tidy the database

WordPress databases grow over time as old post revisions, spam comments, expired temporary data and leftovers from deleted plugins build up. A bloated database slows queries down, especially if key tables such as wp_options or wp_postmeta get very large.

You can limit how many revisions WordPress keeps for each post by adding this to wp-config.php (again, with a copy of the file saved first):4

define( 'WP_POST_REVISIONS', 5 );

This keeps the five most recent revisions of each post from now on. It doesn't remove revisions that already exist.

To clean up existing bloat, database clean-up plugins can remove old revisions, expired temporary data and spam or deleted comments. Clean-ups permanently delete data, so take a database backup first, check exactly what the tool will remove before running it and avoid options you don't understand.

If your wp_options table has grown large, it may contain settings left behind by plugins you no longer use. Our guide to fixing a slow admin dashboard shows how to measure it safely. On WooCommerce stores, also check the size of the Action Scheduler tables, covered in our guide to past-due scheduled actions.

Check your images

Large, uncompressed images are one of the most common causes of slow pages. A single unoptimised photo can be several megabytes, which adds up quickly on slower connections.

There are three things to look at: compressing images so they're smaller without looking worse, using modern formats such as WebP where your setup supports them and uploading images close to the size they're displayed at rather than relying on the browser to shrink them. Image optimisation plugins can handle the first two, including for images you've already uploaded. Take a backup before running one over your whole media library, since some replace the original files.

WordPress also lazy-loads images by default since version 5.5, so images further down the page only load as the visitor scrolls to them.5

Check scheduled tasks

WordPress runs background tasks, such as publishing scheduled posts and checking for updates, through its WP-Cron system. If a task gets stuck, runs for too long or runs too often, it can use up server resources and slow the site down.

If you have WP-CLI, wp cron event list shows every scheduled task, when it's next due and how often it repeats.6 Look for tasks that are overdue (which may be failing) or that run very often. If a particular plugin's task is the problem, check its settings or ask its developer. Moving WP-Cron to a real server cron job also helps on busy sites, and our guide to scheduled posts that fail to publish explains how.

Check third-party scripts

Scripts from other services, such as chat widgets, analytics, social media embeds, adverts and tracking codes, each add requests that can slow your pages down. If one of those services is slow or down, it can hold up the whole page.

Try temporarily removing them one at a time and measuring the difference, on a staging copy if you can. Some of these scripts may be needed for legal, consent or payment reasons, so check before removing anything like a cookie consent tool or payment script. If a script is causing a big slowdown, its provider may offer a lighter way to load it, or you can decide whether it's worth the cost.

Need help with WordPress performance?

If your site is still slow after these steps, or measuring points to a problem that's hard to fix yourself, my WordPress development service and emergency WordPress support include performance investigation, optimisation and hosting reviews. Your hosting provider can also check server resources and logs.


  1. Debugging in WordPress, WordPress Advanced Administration Handbook. ↩

  2. Requirements, WordPress.org. ↩

  3. Cache, WordPress Advanced Administration Handbook. ↩

  4. wp-config.php, WordPress Advanced Administration Handbook. ↩

  5. Lazy-loading images in 5.5, Make WordPress Core, 14 July 2020. ↩

  6. wp cron event list, WP-CLI Commands. ↩

Adam Greenough

Written by Adam Greenough

Freelance web developer with over 15 years of experience building and fixing WordPress sites. I work with businesses across the UK on everything from emergency support to full builds.

Need emergency WordPress support today?

If your site is down, hacked or throwing errors, send me the details and I will assess the problem quickly. Support starts from £50, you will get a fixed quote before any work begins, and if I cannot fix the issue, you will not pay.