Skip to content
Recipes

Improving Page Speed

Page speed depends on your images, hosting, plugins, and page content as well as your theme. Start with image optimization and page caching, then adjust CSS and JavaScript settings if your speed test shows they need attention. These steps apply to WordPress sites using any theme.

  • Back up your website, including the database and uploaded images. If your host offers a staging site, use it to test changes first.
  • Check which performance features your host and existing plugins already provide. Use one tool for each job to avoid overlapping page caching, image optimization, or CSS and JavaScript optimization.
  • Test your homepage and an important inner page with PageSpeed Insights, checking both mobile and desktop results. Save the results so you can compare them later.

PageSpeed Insights includes a simulated test and, when available, data from real visitors. Scores can vary between runs, so use the reported issues and loading measurements to guide your changes. See Google’s explanation of PageSpeed Insights.

Large images can make a page slow even when the rest of the site is well configured. Upload images close to the dimensions you need, rather than using a full-resolution photograph for a small thumbnail.

TinyPNG can compress new uploads and existing Media Library images, including selected thumbnail sizes. It also supports conversion to WebP and AVIF.

  1. Install and activate TinyPNG from Plugins → Add New Plugin.
  2. Open Settings → TinyPNG and follow the instructions to connect an account or enter an API key.
  3. Select the image sizes used on your site, including thumbnails. Review the account’s current free allowance and any costs before processing a large library; each image size counts toward usage.
  4. Go to Media → Bulk TinyPNG to optimize existing images.
  5. Check a few pages to confirm that images still look good and display correctly.

You do not need to regenerate thumbnails after every compression. If your optimizer processes the existing thumbnail sizes, they are already optimized.

Regeneration is useful when you change themes, change image dimensions, or need to rebuild thumbnails from a replaced or optimized source image. After regenerating, make sure the newly created sizes are optimized too.

The original recommendation was Regenerate Thumbnails, available under Tools → Regenerate Thumbnails after activation. Its directory listing currently warns that it has not been tested with recent major WordPress releases, so check compatibility before using it. Your host can also help regenerate thumbnails using WordPress’s WP-CLI media command.

If you enable lazy loading, use it for images farther down the page. Avoid delaying the main image visible when the page first opens; this can make the page’s main content appear later. See Google’s guidance on loading the main page image.

Page caching stores a ready-made copy of a page so the server can send it to visitors without rebuilding it for every request. This can reduce server work and improve response times.

First ask your hosting provider whether page caching is already enabled. If it is, follow the host’s recommended setup. Otherwise, WP Super Cache, maintained by Automattic, is one option. You can also browse other caching plugins.

To get started with WP Super Cache:

  1. Install and activate the plugin.
  2. Open Settings → WP Super Cache and enable caching. Use Simple mode, the plugin’s recommended approach.
  3. Run the plugin’s cache test to confirm that cached pages are being served.
  4. Visit the site while logged out, or in a private browser window, to check the visitor experience.

For WooCommerce stores, confirm that Cart, Checkout, and My Account remain excluded from page caching. Check exclusions in your host’s cache as well as your plugin. Follow WooCommerce’s caching guidance and test adding a product to the cart and completing checkout.

CSS controls how a page looks; JavaScript powers features such as menus, sliders, and forms. Autoptimize can reduce file sizes through minification and adjust how these files load.

If your existing performance plugin already handles these features, configure them there. Otherwise:

  1. Install and activate Autoptimize.
  2. Open Settings → Autoptimize.
  3. Enable one optimization at a time, then save, clear caches, and check your pages.
  4. Test mobile menus, sliders, galleries, forms, and any store features before keeping the setting.

Combining files is optional. Modern connections such as HTTP/2 can load multiple files efficiently, and Autoptimize leaves CSS and JavaScript aggregation off on new installations. Test before enabling it; fewer files do not always mean a faster page.

Deferring scripts or delaying styles can affect interactive features or page layout. If something stops working, turn off the most recent setting, clear caches, and retest. Use the plugin’s exclusions or ask its support team for help with the affected file.

After each change:

  1. Clear the relevant optimization, page, hosting, and CDN caches so visitors receive the updated files and pages.
  2. Open the pages once while logged out to allow the page cache to rebuild.
  3. Repeat your PageSpeed Insights tests on the same URLs and compare several runs.
  4. Check the layout and interactive features on mobile and desktop.

Keep changes that improve loading and preserve normal site behavior. If the site is still slow, use the remaining test findings to decide what to address next. For example, simplify image-heavy sliders, reduce unnecessary third-party embeds, or ask your host to investigate slow server responses. Installing more optimization plugins is not always the next useful step.