Skip to content
ThemesIonic — home
WordPress Tutorials

How to Speed Up a WordPress Site

Measure before you optimise. Most WordPress sites are slow for three fixable reasons: no page cache, oversized images and too much JavaScript — in that order of impact.

3 min read intermediate

Start here: run one test and write down three numbers — server response time (TTFB), Largest Contentful Paint, and total page weight. Optimise whichever is worst. Applying every tip in a checklist without measuring usually breaks something and improves little.

Measure the right things

Use two sources:

  • Lab data from a page speed tool, which is repeatable and good for comparing before and after.
  • Field data from Search Console's Core Web Vitals report, which reflects real visitors and is what search engines actually use.

Three metrics matter:

Metric Good What it reflects
TTFB under 0.5 s Hosting, caching, PHP and database work
LCP under 2.5 s How fast the main content appears
CLS under 0.1 Layout stability while loading

Test the homepage and one interior page. They often have completely different problems.

1. Page caching

Without it, every visit runs PHP, queries the database and rebuilds the same HTML. With it, most visitors get a stored file.

  • Use your host's built-in cache if it has one; server-level caching beats a plugin.
  • Otherwise install one caching plugin — never two, since they conflict over the same drop-in files.
  • Exclude cart, checkout, account and any personalised page.
  • Confirm it works by loading a page logged out and checking the response headers for a cache hit, as described in how to check HTTP headers.

If TTFB stays high with caching on, the cache is not being hit. Logged-in sessions, cookies set by an analytics or consent script, and query strings all bypass many caches.

2. Images

Images are usually the largest part of page weight and the most common LCP element.

  • Serve WebP or AVIF with a fallback.
  • Size files to the space they occupy — a 4000px photo in an 800px slot wastes most of what it downloads.
  • Compress once, in one place, at a quality you have actually looked at.
  • Lazy-load below-the-fold images, but never the LCP image, which should load eagerly with fetchpriority="high".
  • Always set width and height so the browser reserves space — that is also the main defence against layout shift.

Details on sizes and quality are in how to fix blurry images in WordPress.

3. Scripts and stylesheets

Every plugin that enqueues assets on every page adds up. Audit what a single page actually loads in the Network tab, then:

  • remove plugins you no longer use — deactivating is not enough, see deleting a plugin completely;
  • load page-specific assets only where they are needed, such as a contact form script on the contact page;
  • defer non-critical JavaScript, and delay third-party scripts until interaction where the vendor allows it;
  • limit web fonts to the weights you use and self-host them where licensing permits, with font-display: swap.

Third-party embeds — chat widgets, heat maps, ad and consent scripts — often cost more than everything else combined. Measure each one by removing it temporarily and retesting.

4. Hosting and PHP

No amount of front-end work compensates for a server that takes a second to respond.

  • Run a current PHP version; each recent release has been meaningfully faster than the last. Test on staging first — see what breaks after a PHP update.
  • Enable object caching (Redis or Memcached) if the host supports it, particularly for WooCommerce and membership sites where pages cannot be fully cached.
  • Choose a host whose plan matches your traffic. Cheap shared hosting throttles under load, which shows up as random slow requests rather than consistent ones — hosting comparison covers the trade-offs.

5. Database

Over time, revisions, transients, spam and orphaned metadata accumulate.

-- The autoloaded options read on every single request.
SELECT SUM(LENGTH(option_value)) AS autoload_bytes
FROM wp_options WHERE autoload = 'yes';

Anything much above a megabyte deserves investigation. Limit revisions in wp-config.php:

<?php
define('WP_POST_REVISIONS', 5);

Clean up with care and a backup — database maintenance covers what is safe to delete.

6. A CDN, if the audience is spread out

A CDN serves static files from a location near the visitor, and absorbs traffic spikes. It is most valuable for international audiences and media-heavy sites. Configure it after caching and images are sorted; adding it first hides problems rather than fixing them.

Where the biggest wins usually are

Situation Highest-impact change
No caching at all Page caching
Huge unoptimised photos Image sizing and format
40+ active plugins Remove and consolidate
Slow admin, fast front end See speeding up the WordPress admin
Elementor or heavy builder Trim widgets and global fonts
Store or membership site Object cache plus fragment-level caching

Avoid the common mistakes

  • Do not run two caching plugins.
  • Do not enable every optimisation toggle at once; enable one, measure, keep or discard.
  • Do not minify and combine JavaScript blindly — it is the most frequent cause of broken forms and menus.
  • Do not chase a perfect score. A site that loads in 1.2 seconds with a score of 85 is better than one at 98 that took a month of tuning.
  • Do measure logged out, in a private window, with the cache warm.

Frequently asked

Page caching on an uncached site. It removes PHP and database work from most requests, and typically cuts server response time from hundreds of milliseconds to tens.
It helps most when visitors are far from the server or the site is media heavy. For a local audience on decent hosting, caching and image work usually deliver more for less complexity.
Lab scores are simulations. Field data in Search Console reflects real devices and networks, and slow phones on mobile connections behave very differently from a test on a fast desktop.

Related guides