A slow WordPress site drives visitors away and hurts search rankings. Before rewriting anything or switching themes, it is better to measure where time is actually lost: in the vast majority of cases, the problem comes from one of the five causes below. For each one, here is how to spot it and fix it.

Start by measuring

Two figures are enough to guide the diagnosis:

curl -o /dev/null -s -w "TTFB: %{time_starttransfer} s\n" https://your-site.com/

On a copy of the site, the Query Monitor plugin then details SQL queries and the time spent by each plugin.

1. Undersized shared hosting

On low-end shared hosting, your site shares the processor and memory with dozens of others. A simple test is to measure the response time of a static HTML page, without WordPress: if it already exceeds 300 to 400 ms, the problem is at the source, before WordPress even starts.

2. Too many plugins, or badly written ones

Every active plugin adds queries, JavaScript and sometimes calls to external services. What matters is not the number of plugins but their quality: two or three poorly written plugins do more damage than fifteen well-coded ones.

3. Images that are too heavy

A 4 MB photo displayed 600 pixels wide wastes bandwidth for nothing.

4. No caching at all

Without caching, WordPress rebuilds every page on every visit: it queries the database, runs the PHP and assembles the HTML. Several layers work together:

On a WooCommerce store, the cart, checkout and customer account must be excluded from the page cache, otherwise customers would see someone else’s cart.

5. A database that grew without maintenance

Over the years, the database accumulates post revisions, expired transients and settings left behind by uninstalled plugins. Some of these settings are loaded on every page: these are the “autoload” options. To see the heaviest ones:

SELECT option_name, LENGTH(option_value) AS size
FROM wp_options
WHERE autoload IN ('yes', 'on', 'auto', 'auto-on')
ORDER BY size DESC
LIMIT 10;

Any database clean-up must come after a verified backup: see the backup rule almost nobody follows.

In which order to fix things

Deal with the causes in this order: hosting, caching, images, plugins, database. Fixing plugins before having decent hosting, for example, gives disappointing results and wastes time. And measure again after each step, to know what actually made a difference.

The checklist

  1. Measure server response time and the mobile PageSpeed score.
  2. Recent PHP 8, OPcache enabled, hosting sized for the traffic.
  3. Page cache on, with the right exclusions for WooCommerce.
  4. Images resized, compressed, in WebP, with width and height.
  5. Unused plugins removed, slow plugins identified and replaced.
  6. Revisions limited, transients and orphaned options cleaned, after a backup.
  7. Measure again.

Going further: my expertise: Freelance WordPress developer · read also: WordPress or an all-in-one builder: which one for a professional website?