DEV Community

Nevik Schmidt
Nevik Schmidt

Posted on

WordPress Speed Optimization: How I Got a Site From 3.8s to 0.4s

Last month, a client came to me with a WordPress site loading in 3.8 seconds. Their bounce rate was 68%. Google had demoted them from page 1.

90 minutes later: 0.4 seconds. Bounce rate dropped to 31% within two weeks. Here's exactly what I did.

The Audit First

Before touching anything, I ran:

The biggest offenders were immediately obvious:

  1. Images: 12 unoptimized JPEGs totaling 8.4MB
  2. Render-blocking: 6 JS files loading in <head>
  3. No caching: Every request hit PHP/MySQL
  4. Google Fonts: Loading 4 font families from Google's servers
  5. No CDN: All assets served from one shared hosting server

Step 1: Images (Biggest Win — 2.1s Saved)

Converted all images to WebP and enabled lazy loading:

// functions.php - Enable WebP support
add_filter('upload_mimes', function($mimes) {
    $mimes['webp'] = 'image/webp';
    return $mimes;
});
Enter fullscreen mode Exit fullscreen mode

Used Imagify (free tier) to bulk-convert existing images. Before: 8.4MB total. After: 1.1MB.

Also added native lazy loading to all images below the fold:

<img src="image.webp" loading="lazy" alt="...">
Enter fullscreen mode Exit fullscreen mode

Time saved: ~2.1 seconds

Step 2: Caching (0.8s Saved)

Installed WP Rocket (worth every cent) with these settings:

  • Page caching: ON
  • Browser caching: ON
  • GZIP compression: ON
  • Database optimization: weekly

If you can't afford WP Rocket, W3 Total Cache (free) gets you 80% of the way there.

Time saved: ~0.8 seconds

Step 3: Eliminate Render-Blocking JS (0.5s Saved)

Moved all non-critical scripts to footer:

// Remove scripts from head, add to footer
function move_scripts_to_footer() {
    wp_dequeue_script('jquery');
    wp_enqueue_script('jquery', false, [], false, true);
}
add_action('wp_enqueue_scripts', 'move_scripts_to_footer', 100);
Enter fullscreen mode Exit fullscreen mode

Also deferred scripts with the defer attribute via WP Rocket's minification settings.

Time saved: ~0.5 seconds

Step 4: Self-Host Google Fonts (0.3s Saved)

Google Fonts add 2 external HTTP requests AND send user IPs to Google (GDPR issue!).

Fix: Download fonts and serve locally.

  1. Go to google-webfonts-helper.herokuapp.com
  2. Download your fonts
  3. Upload to /wp-content/themes/your-theme/fonts/
  4. Replace the Google Fonts <link> with a local @font-face CSS

Time saved: ~0.3 seconds + GDPR compliance bonus

Step 5: CDN (0.2s Saved)

Enabled Cloudflare free tier — took 5 minutes. Cloudflare caches static assets at edge nodes closest to each visitor.

Time saved: ~0.2 seconds

Final Result

Metric Before After
Load time 3.8s 0.4s
Page size 9.2MB 1.4MB
Requests 87 34
PageSpeed Score 31 94
Bounce rate 68% 31%

The Checklist

  • [ ] Convert images to WebP + lazy load
  • [ ] Install caching plugin (WP Rocket or W3 Total Cache)
  • [ ] Move JS to footer / defer non-critical scripts
  • [ ] Self-host Google Fonts
  • [ ] Enable Cloudflare CDN
  • [ ] Minify CSS/JS
  • [ ] Remove unused plugins (every plugin adds load)
  • [ ] Use a fast hosting provider (not GoDaddy shared)

Need this done for your WordPress site? I offer Speed Optimization starting at €199 — guaranteed improvement or your money back.

👉 Book at nevki.de

Top comments (0)