Table of Contents
SEO 9 min read

How to speed up a WordPress website for maximum performance

The loading speed of a WordPress website directly affects user experience, the conversion rate and the page experience signals that Google uses when ranking search results. A website that...

2026-03-30
How to speed up a WordPress website for maximum performance

The loading speed of a WordPress website directly affects user experience, the conversion rate and the page experience signals that Google uses when ranking search results.

A website that takes more than 3 seconds to load loses over 50% of its visitors, and every additional second reduces the conversion rate by roughly 7%. This is not an abstract statistic, it is the reality WordPress website owners who neglect performance face every day.

WordPress is a flexible platform, but that flexibility comes at a performance cost.

Themes with excessive features, plugins that load resources on every page, unoptimized images and the lack of a caching system are the main factors that slow down a WordPress website.

On top of these come poorly configured hosting, a database bloated with useless data and the absence of a CDN for distributing static content. The good news is that most of these problems can be solved without advanced technical knowledge, by following a systematic process.

In this guide you will discover the most effective methods of optimizing WordPress speed, from simple settings you can apply in a few minutes to advanced optimizations that turn a slow website into a fast, high-performing one.

Each section includes concrete steps and recommended tools, so you can start acting right away.

How to speed up a WordPress website for maximum performance

WordPress speed optimization works on several levels: the server the website runs on, the WordPress configuration, content optimization and delivery to visitors. Each level contributes to the total loading time, and a systematic approach across all levels produces the best results.

There is no single miracle solution; excellent performance is the result of a combination of optimizations applied correctly.

Measuring current performance

Before optimizing, you need to measure current performance to identify the problems and to assess later progress. Without baseline data, you will not know whether the changes you make produce real results. Use these free tools:

  • Google PageSpeed Insights: analyses the Core Web Vitals metrics and gives specific recommendations for mobile and desktop. The performance score and the LCP, FID and CLS metrics are the most relevant.
  • GTmetrix: provides a detailed analysis of the loading waterfall, identifying exactly which resources slow down the website and how much time each one consumes.
  • Google Search Console: the Core Web Vitals report in Search Console shows real user performance, based on field data, not just lab tests.
  • WebPageTest: allows testing from multiple locations and provides advanced details, including a frame-by-frame filmstrip of the page load.

Note down the initial scores and repeat the measurements after each optimization to assess the impact. A change log will help you identify what worked and what did not produce results.

Server and hosting optimization

Choosing the right hosting

Hosting is the foundation of performance. A slow server will limit any optimization at the WordPress level, no matter how many caching plugins you install. The features of high-performing WordPress hosting include:

  • LiteSpeed or Nginx server: much faster than Apache for WordPress. LiteSpeed also offers native compatibility with the LiteSpeed Cache plugin, one of the most powerful free solutions.
  • NVMe SSD: fast storage that speeds up file reads and database queries compared with standard SSDs or, worse, with classic HDDs.
  • PHP 8.2 or 8.3: recent PHP versions are 30-50% faster than PHP 7.4. If your hosting offers PHP 8.3, upgrade as soon as you have checked the compatibility of your theme and plugins.
  • OPcache enabled: stores compiled PHP code in memory, eliminating recompilation on every request. It greatly reduces server response time.
  • Nearby server location: a server in Europe reduces latency for visitors from Romania. If your audience is predominantly from Romania, choose a server in Romania, Germany or the Netherlands.
  • HTTP/2 or HTTP/3: modern protocols allow resources to be downloaded in parallel, reducing the effective number of requests.

PHP configuration

Check and optimize the PHP settings in cPanel or in your hosting control panel:

  • Upgrade to the latest PHP version supported by WordPress and by your plugins
  • Increase memory_limit to at least 256 MB to avoid memory errors
  • Enable OPcache if it is not enabled by default and set opcache.memory_consumption to 128 MB
  • Set max_execution_time to 300 to prevent timeouts on complex operations
  • Enable Gzip or Brotli compression at server level to reduce the size of HTTP responses

Cache configuration

Page-level cache

Page caching is the most effective optimization available for WordPress. Instead of processing PHP and querying the database on every visit, the server serves a pre-generated static HTML version. Response time drops from hundreds of milliseconds to a few dozen milliseconds. The main options are:

  • LiteSpeed Cache: the best performer for LiteSpeed servers. Minimal configuration needed, works excellently with the default settings and includes image optimization, CSS/JS minification and CDN support.
  • WP Rocket: a premium plugin with the simplest setup. It works on any type of server and covers all aspects of optimization: cache, minification, lazy load, DNS prefetch.
  • W3 Total Cache: free with advanced options, recommended for technically experienced users who want granular control.

Database cache

Repetitive database queries can be stored in memory using Redis or Memcached. This greatly reduces processing time for dynamic pages that cannot be fully cached: the shopping cart, account pages, search results. Redis is preferred over Memcached because of data persistence and broader support in the WordPress ecosystem.

Browser-level cache

Configure cache headers to instruct visitors' browsers to store static resources (images, CSS, JavaScript) locally. On later visits, the browser will no longer download these resources from the server. Add the following to the .htaccess file:

# Cache browser pentru resurse statice
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/avif "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-font-woff2 "access plus 1 year"
</IfModule>

Image optimization

Compression and modern formats

Images are usually the biggest factor affecting loading speed; they can account for 50-80% of the total page weight. The right approach involves several steps:

  • Automatic compression: install a plugin such as ShortPixel or Imagify that automatically compresses images on upload, with no visible loss of quality.
  • WebP format or AVIF: modern formats offer 25-50% better compression than JPEG/PNG at the same visual quality. Image optimization plugins generate WebP versions automatically.
  • Correct dimensions: do not upload 4000px images if they are displayed at 800px. Resize before uploading or configure automatic resizing through WordPress.
  • Width and height attributes: always specify image dimensions in the HTML to avoid Layout Shift (CLS), an important Core Web Vitals metric.

Lazy loading

Lazy loading defers the loading of images that are not visible on screen when the page is accessed. WordPress has included native lazy loading since version 5.5 through the loading="lazy" attribute, but caching plugins offer more advanced implementations that also cover iframes, videos and social media widgets. This technique greatly reduces the amount of data downloaded on the first visit.

CSS and JavaScript optimization

Minification and combining

Minification removes spaces, comments and unnecessary characters from CSS and JavaScript files, reducing their size by 10-30%. Combining merges several files into one, reducing the number of HTTP requests. With HTTP/2, combining has less impact than in the past, but minification is always beneficial. Caching plugins such as WP Rocket and LiteSpeed Cache include these functions and can apply them automatically.

Removing unused resources

Many plugins and themes load CSS and JavaScript on all pages, even though they are only needed on certain pages. A contact plugin that loads its scripts on the homepage or in the shopping cart is an unnecessary source of slowness. Identify these resources with:

  • The Coverage tab in Chrome DevTools: shows what percentage of the CSS and JavaScript is not used on the current page. Open DevTools (F12) > Coverage tab > refresh the page.
  • The Asset CleanUp plugin: allows selective disabling of resources per page or per page type, with a visual interface.
  • The Perfmatters plugin: offers granular control over the scripts that are loaded, with global or conditional disabling options.

Deferred JavaScript loading

Adding the defer or async attributes to JavaScript scripts lets the browser keep processing the HTML while it downloads the scripts. The defer attribute is preferred for scripts that depend on the full DOM, and async for independent scripts. This greatly improves the Largest Contentful Paint (LCP) metric, which is key to the Google PageSpeed score.

Database optimization

The WordPress database accumulates useless data over time: old post revisions, spam comments approved by mistake, expired transient options and orphaned metadata left behind after plugins are uninstalled. A bloated database means slower queries. Periodic cleanup improves query speed and reduces the size of backups:

  • Limit post revisions to 3-5 using the WP_POST_REVISIONS constant in wp-config.php
  • Automatically empty the trash after 7 days using EMPTY_TRASH_DAYS
  • Use the WP-Optimize or Advanced Database Cleaner plugin for automatic cleanup
  • Optimize the database tables monthly from phpMyAdmin using the OPTIMIZE TABLE command
  • Identify and delete orphaned records from the wp_postmeta and wp_options tables

Using a CDN

A CDN (Content Delivery Network) distributes the website's static content across servers around the world, reducing the physical distance between the server and the visitor. A visitor from Cluj will no longer download images from a server in Germany, but from a CDN node that is much closer geographically:

  • Cloudflare: a free CDN with DDoS protection, minification and image optimization. Setup from cPanel is simple and the free plan is enough for most websites.
  • BunnyCDN: a premium CDN with affordable pricing and excellent performance in Europe. It integrates easily with WordPress caching plugins.
  • Cloudflare APO: a premium extension that also caches dynamic WordPress HTML pages, giving performance close to a static site even for pages personalized per visitor.

Optimizations in wp-config.php

The wp-config.php file is where you can enable several important optimizations. Add these constants before the line /* That's all, stop editing! */:

// Limitează revizuirile la 3
define('WP_POST_REVISIONS', 3);

// Golește coșul de gunoi la 7 zile define('EMPTY_TRASH_DAYS', 7);

// Crește memoria disponibilă define('WP_MEMORY_LIMIT', '256M');

// Dezactivează WP-Cron și folosiți un cron real define('DISABLE_WP_CRON', true);

// Activează compresia GZIP dacă nu e activată la nivel de server define('COMPRESS_PAGES', true); define('COMPRESS_SCRIPTS', true);


If you disable WP-Cron, set up a real cron job from cPanel that hits wp-cron.php every 15 minutes. The default WP-Cron is triggered by visits, which can add inconsistent latency.


Web fonts and the FOIT/FOUT effect


Google Fonts or Adobe Fonts web fonts can block page rendering if they are loaded incorrectly. Optimize font loading as follows:

  • Host the fonts locally on your own server instead of loading them from Google Fonts: it removes an external request and GDPR privacy issues
  • Use the font-display: swap attribute to show the text in the fallback font while the web font downloads
  • Preload critical fonts with <link rel="preload"> in the header
  • Limit the number of font variants (weights and styles) to the minimum necessary

Continuous performance monitoring


Speed optimization is not a one-off action. Every new plugin, every theme update and every new page can affect performance. Regularly monitor the Core Web Vitals metrics in Search Console, test periodically with PageSpeed Insights and keep a minimal set of plugins up to date.


Set up automatic alerts through services such as UptimeRobot so you are notified immediately if your website becomes slow or unavailable.


A well-optimized WordPress website loads in under 2 seconds, gives visitors an excellent experience and improves both user satisfaction and ranking in Google's organic results.

Source references

Dorel Tănase

Original author at GOAI. Published here in English with permission.

Share this article

Back to Blog

Our network