This article is part of the WordPress Forensics series — practical guides for WordPress security, recovery, and migration.

Introduction

Your WordPress site is slow. You have tried caching plugins. You have upgraded hosting. It is still slow. The problem is that you are treating symptoms, not causes. This guide teaches you to diagnose performance issues at the source — the same forensics approach we use on client sites.

Establishing Baselines

Tools for Measurement

  • Google PageSpeed Insights — Core Web Vitals, mobile/desktop
  • GTmetrix — Waterfall analysis, historical tracking
  • WebPageTest — Multiple locations, detailed timing
  • Query Monitor plugin — Database queries, hooks, HTTP calls
  • Chrome DevTools — Network panel, Performance panel

Key Metrics to Track

  • Time to First Byte (TTFB) — Server response time
  • Largest Contentful Paint (LCP) — Main content load time
  • First Input Delay (FID) — Interactivity delay
  • Cumulative Layout Shift (CLS) — Visual stability
  • Total page size — All resources combined
  • Number of requests — HTTP requests to load page

Database Performance Issues

Symptoms

  • High TTFB (> 600ms)
  • Slow admin dashboard
  • Timeout errors during peak traffic

Common Causes

  • Bloated wp_options table — Autoloaded options over 1MB
  • Post revisions — Thousands of revision records
  • Transients — Expired transients never cleaned
  • Orphaned metadata — Meta for deleted posts/users
  • Plugin data — Abandoned plugin tables

Diagnostic Queries

-- Check autoloaded options size
SELECT SUM(LENGTH(option_value)) as autoload_size 
FROM wp_options WHERE autoload = 'yes';

-- Count post revisions
SELECT COUNT(*) FROM wp_posts WHERE post_type = 'revision';

-- Find largest options
SELECT option_name, LENGTH(option_value) as size 
FROM wp_options ORDER BY size DESC LIMIT 20;

Plugin Performance Issues

Symptoms

  • Slow page loads across entire site
  • Specific pages much slower than others
  • High CPU usage

Diagnosing Plugin Impact

  1. Install Query Monitor plugin
  2. Note baseline queries and load time
  3. Deactivate plugins one by one
  4. Measure after each deactivation
  5. Identify the culprit(s)

Common Plugin Offenders

  • Page builders loading on every page
  • Social sharing plugins with API calls
  • Analytics plugins not using async
  • Related posts plugins with complex queries
  • Broken plugins making failed HTTP requests

Theme Performance Issues

Common Theme Problems

  • Unoptimized images in theme assets
  • Excessive Google Fonts loading
  • Render-blocking CSS/JS
  • Inefficient template queries
  • No lazy loading implemented

Theme Forensics

  1. Switch to default theme (Twenty Twenty-Four)
  2. Measure performance difference
  3. If significantly faster, theme is the issue
  4. Review theme's functions.php for inefficient code
  5. Check for direct database queries in templates

Hosting and Server Issues

Symptoms

  • Consistently high TTFB regardless of page
  • Performance degrades during traffic spikes
  • Slow even with caching enabled

Hosting Factors

  • Shared hosting overload — Too many sites on server
  • PHP version — PHP 7.4 is 3x slower than 8.2
  • OPcache disabled — PHP recompiling on every request
  • Insufficient memory — PHP memory limit too low
  • Disk I/O bottleneck — Slow storage
  • Geographic distance — Server far from users

Caching Misconfigurations

Why Caching Is Not Working

  • Logged-in users bypassing cache
  • WooCommerce cart/checkout not excluded properly
  • Cache lifetime too short
  • Browser caching not configured
  • CDN not properly integrated
  • Object caching not enabled

Caching Verification

  1. Check HTTP headers for cache status
  2. Verify cache files exist on disk
  3. Test as logged-out user in incognito
  4. Use curl to check response headers

Image and Media Issues

Common Problems

  • Uncompressed images (5MB+ files)
  • Wrong format (PNG for photos, JPEG for graphics)
  • No WebP/AVIF serving
  • Images not sized correctly (serving 4000px for 400px container)
  • No lazy loading for below-fold images

Image Audit

  1. Check largest images in uploads directory
  2. Review srcset implementation
  3. Verify lazy loading is active
  4. Test WebP delivery

JavaScript and CSS Issues

Blocking Resources

  • Render-blocking scripts in head
  • Excessive inline CSS
  • Unused CSS loaded on every page
  • Third-party scripts blocking render

JS/CSS Forensics

  1. Review Coverage panel in Chrome DevTools
  2. Identify unused CSS/JS percentage
  3. Check for duplicate libraries (multiple jQuery versions)
  4. Audit third-party scripts impact

Performance Remediation Priorities

  1. Server/Hosting — Foundation must be solid
  2. Database — Clean and optimize
  3. Caching — Implement properly
  4. Images — Compress and lazy load
  5. Plugins — Remove or replace slow ones
  6. Theme — Optimize or replace
  7. JS/CSS — Defer, async, minify

Conclusion

Performance optimization without diagnosis is guesswork. Use forensics to identify the actual bottlenecks, prioritize by impact, and measure results. A fast WordPress site is possible — but only if you treat the causes, not just the symptoms.