WordPress is the most popular platform in the world for creating websites and portals. However, if not optimized correctly, excessive plugins and heavy databases can slow down the user experience, which directly affects your Google ranking (Core Web Vitals) and your lead conversion rate.
Below, we list the main optimizations to guarantee maximum speed for your WordPress.
1. Choose the Right Infrastructure (Managed Hosting)
Most WordPress slowness starts at the hosting server. Cheap shared hosting plans do not have enough dedicated resources to process dynamic PHP requests quickly.
Solution:
- Host WordPress on a KVM VPS with NVMe disk. KVM isolates CPU and memory from other sites. NVMe does the read and write in milliseconds. The plan is on hosting.
- Use a server configured with LiteSpeed or Nginx as a reverse proxy to process static requests much faster than traditional Apache.
2. Implement Page and Object Caching
WordPress generates pages dynamically by querying the database via PHP for each visit. Caching saves a static version (HTML) of each page, delivering it instantly to subsequent visitors.
What to configure:
- Page Cache: Plugins like LiteSpeed Cache or WP Rocket save static versions of pages.
- Object Cache: Configuring Redis or Memcached on the server allows saving repetitive database queries in RAM, reducing loading time (Time to First Byte - TTFB).
3. Image Optimization and Lazy Loading
Heavy images are the main culprits in bandwidth consumption on visitors' mobile phones.
How to optimize:
- Convert all images to modern, compressed formats like WebP or AVIF.
- Ensure the lazy loading tag (
loading="lazy") is active on all images below the page fold, avoiding loading media that the visitor has not yet viewed.
4. Nginx and Redis on the server
A cache plugin does not replace the cache in front of PHP. fastcgi_cache_path belongs in the http block. The rest belongs in the site's server block. Skip the cache for logged-in users and form posts. Anonymous HTML stays for 60 minutes:
fastcgi_cache_path /var/cache/nginx/wordpress levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
set $skip_cache 0;
if ($request_method = POST) { set $skip_cache 1; }
if ($query_string != "") { set $skip_cache 1; }
if ($http_cookie ~* "wordpress_logged_in") { set $skip_cache 1; }
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 60m;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
add_header X-Cache-Status $upstream_cache_status;
}
Check the PHP socket with ls /run/php. The header X-Cache-Status: HIT on the second anonymous visit means the page did not go back to the database.
Redis holds the object cache. On Ubuntu:
sudo apt install -y redis-server
sudo systemctl enable --now redis-server
cd /var/www/html
wp plugin install redis-cache --activate
wp redis enable
wp redis status
In wp-config.php, before "That's all, stop editing!":
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_CACHE', true);
wp redis status must show Status: Connected. Redis listens only on 127.0.0.1. Do not open port 6379 on the firewall.
Conclusion
Having a fast site is essential to retain visitors and close sales in the B2B digital environment. By structuring your WordPress under managed hosting with appropriate caching and optimized images, your site will load instantly, improving your SEO and generating many more leads.