Performance & Security

WordPress Speed Optimization: A Step-by-Step Guide

A practical, step-by-step guide to making a slow WordPress site load faster, starting with the fixes that make the biggest difference.

Quick answer: To speed up a WordPress site, measure first, then work in this order: move to good hosting with a current PHP version, install a page caching plugin, compress and resize images, remove plugins you do not need, combine and minify CSS and JavaScript, and serve static files through a CDN. Those steps fix most slow WordPress sites without touching the design.

A slow site frustrates visitors, loses sales and can hold back rankings, since Google uses page speed as a ranking signal. The good news is that WordPress speed problems tend to have the same handful of causes. This guide takes you through them in the order we tackle them.

Step 1: Measure before you change anything

Pick two or three key pages, such as the home page, a service page and a blog post. Test them with:

  • Google PageSpeed Insights for a score and specific suggestions on mobile and desktop
  • GTmetrix for a waterfall chart showing every file the page loads and how long each one takes
  • Pingdom Tools for a quick check of load time and page size from different locations

Write down the load time, total page size and number of requests for each page. Test a few times, because results vary. These numbers are your baseline.

Step 2: Fix the hosting and server

No plugin can make up for a slow server. Signs of a hosting problem include a long wait before the first byte arrives, often shown in GTmetrix as a long “waiting” time on the first request.

Choose better hosting

Very cheap shared hosting packs many sites onto one server. If your site matters to your business, consider managed WordPress hosting or a VPS with enough memory. Good hosts tune their servers specifically for WordPress.

Upgrade PHP

PHP is the language WordPress runs on. Many hosts still run old versions. Moving to PHP 5.6 brings a solid improvement over older releases, and PHP 7, released at the start of this month, is dramatically faster in early tests. Check that your theme and plugins are compatible before switching, ideally on a staging copy of the site.

Turn on HTTP/2 if your host supports it

HTTP/2 lets browsers download many files over one connection at once. Most browsers support it, but it requires HTTPS. If you are planning that move, our guide on HTTPS migration without losing rankings covers the steps.

Step 3: Add page caching

By default, WordPress builds every page from scratch on each visit, running PHP code and database queries. Page caching saves a finished copy of each page and serves that instead, which is far faster.

Popular options include WP Super Cache, W3 Total Cache and WP Rocket. Some managed hosts provide their own server level caching, in which case you may not need a plugin at all. Start with the basic settings, check the site still works, then turn on extra options one at a time.

Remember to exclude pages that must never be cached, such as cart, checkout and account pages on an ecommerce site.

Step 4: Optimise images

Images are usually the biggest part of a page. Common problems are photos uploaded straight from a camera at several megabytes each, and large images displayed small.

  • Resize before uploading. There is rarely a need for images wider than your content area.
  • Compress images. Plugins such as EWWW Image Optimizer and WP Smush can compress existing and new uploads automatically.
  • Use the right format. JPEG for photos, PNG for graphics with sharp edges or transparency.
  • Lazy load below the fold. A lazy load plugin delays loading images until the visitor scrolls near them.

WordPress 4.4, released this month, also adds responsive images, so browsers can choose smaller image sizes on smaller screens automatically.

Step 5: Audit your plugins

Every active plugin can add code, database queries and extra files to each page. The number of plugins matters less than what they do.

  • Deactivate plugins you no longer use, then delete them
  • Look for plugins that load scripts and styles on every page when they are only needed on one, such as a contact form or slider
  • Replace heavy plugins with lighter alternatives where you can
  • Use a tool such as P3 (Plugin Performance Profiler) to see which plugins slow page loads most

Sliders, social sharing widgets and related posts plugins are frequent offenders.

Step 6: Reduce and combine CSS and JavaScript

Themes and plugins often load many separate CSS and JavaScript files. Each one is an extra request.

  • Minify files to strip out spaces and comments
  • Combine files where it makes sense, to reduce requests
  • Move JavaScript to the footer or load it asynchronously so it does not block the page from appearing

Plugins such as Autoptimize or the options in W3 Total Cache handle this. Test carefully, because combining scripts can break features. If something stops working, exclude that file.

Step 7: Use a CDN

A content delivery network stores copies of your images, CSS and JavaScript on servers around the world, so visitors download them from somewhere nearby. Services such as CloudFlare, MaxCDN and Amazon CloudFront all work well with WordPress. CloudFlare’s free plan is an easy start for small sites.

Step 8: Clean up the database

Over time the WordPress database collects post revisions, spam comments, expired transients and leftover data from deleted plugins. Plugins such as WP-Optimize can remove this clutter. Take a full backup first, and consider limiting the number of saved revisions in wp-config.php.

Step 9: Look at the theme

If the site is still slow after all of the above, the theme may be the problem. Heavy multipurpose themes often load fonts, scripts and features you never use. Test by switching to a default theme on a staging site. If the speed improves dramatically, it may be worth moving to a lighter theme or a custom one.

Step 10: Measure again

Rerun the same tests on the same pages and compare with your baseline. Keep notes on what you changed, so you know what made the difference and what to check if problems return after future updates.

Quick wins checklist

  • Current PHP version on decent hosting
  • Page caching turned on
  • Images resized and compressed
  • Unused plugins deleted
  • CSS and JavaScript minified
  • CDN for static files
  • External scripts, such as chat widgets and social embeds, kept to a minimum

FAQ

What is a good load time for a WordPress site?

Faster is always better. Aim to beat your competitors and keep the page usable within a couple of seconds on a typical connection.

Will a caching plugin break my site?

Occasionally, especially with aggressive minify settings. Change one setting at a time and test after each one.

Do I need a developer to speed up WordPress?

Many of these steps can be done by a confident site owner. Hosting moves, PHP upgrades and theme problems are where a developer helps most.

Want a faster site without the trial and error?

We speed up WordPress sites as part of our website work, from hosting and caching to theme fixes. Learn how we turn visitors into customers.

About the author

Imran M

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready to improve your website?

Let's build a faster, higher performing website.