Speed up a WordPress site
A fast site keeps visitors on the page and is easier for search engines to crawl. This guide covers the changes that usually make the biggest difference to a WordPress site, in roughly the order to try them. It is for site owners who want practical steps, not deep server tuning.
Measure first
Before you change anything, measure the speed so you can tell whether a change helped.
- Open PageSpeed Insights and test your home page and one or two typical pages, such as a blog post or product page.
- Note the main scores and the suggestions listed under the results.
- Repeat the test after each change. Results vary a little between runs, so look at the trend rather than one number.
Use caching
Without caching, WordPress builds every page from scratch for every visitor: it runs PHP code and asks the database for content each time. Caching saves the result so it can be reused.
- Page caching stores a finished copy of each page and sends it to the next visitor straight away. It usually gives the biggest improvement for pages that look the same for everyone, such as posts and landing pages. Your host may provide it, or you can use a caching plugin. Use only one page caching method at a time.
- Object caching keeps the results of database queries in memory, using software such as Redis or Memcached on the server. It helps most on busy or dynamic sites, such as shops, membership sites and sites with many logged-in users. It needs support from your hosting.
After changing content, clear the cache if your changes do not appear.
Make images lighter
Large images are a common reason for slow pages.
- Resize before uploading. A photo straight from a camera can be thousands of pixels wide. Scale it to the largest size it will be shown at.
- Use modern formats. WordPress core supports uploading WebP and AVIF images, which are usually much smaller than JPEG or PNG at similar quality. Your server's image library must support the format; WordPress warns you if it does not.
- Compress images. An image optimisation plugin can compress existing images and convert them to modern formats.
WordPress also adds lazy loading to images by default. Lazy loading tells the browser to wait before downloading images further down the page until the visitor scrolls near them.
Review your plugins
Every active plugin adds code that may run on every page. Some add their own scripts, styles and database queries.
- Deactivate and delete plugins you no longer need.
- Replace several small plugins with one that does the job, where that makes sense.
- Watch out for heavy features such as sliders, page view counters, related-post widgets and social feeds.
To find a slow plugin, test the site's speed, deactivate one plugin, and test again. Do this on a staging copy if you can, so visitors are not affected.
Choose a well-built theme
A theme that loads many fonts, scripts and animations slows every page. If your theme is heavy, a lighter, well-maintained theme can help more than any plugin. Test a new theme on a staging copy before switching.
Run a current PHP version
PHP is the programming language WordPress runs on. Newer supported PHP versions are generally faster and receive security fixes. Check which versions WordPress currently recommends on the WordPress requirements page, make sure your plugins and theme support that version, and then change it in your hosting settings. See PHP versions and settings.
Older plugins or themes may not work on a newer PHP version. Take a backup first and test the site straight after the change.
Use a CDN
A content delivery network (CDN) keeps copies of your images, scripts and styles on servers in many places, so visitors download them from somewhere nearby. A CDN helps most when your visitors are spread across different countries. It usually works by changing your DNS or by adding a plugin that rewrites file addresses.
When the server is the limit
If the site is still slow after these steps, check whether your hosting account is reaching its resource limits, such as CPU or memory, especially at busy times. See Resource limits and A slow website.
DomainPilot WordPress hosting includes object caching from the WP Scale plan. See WordPress hosting.