Published Dec 3, 2026

Most Legacy WordPress Sites Don't Need a Rewrite. They Need a Profiler.

By Kevin Champlin

The kickoff meeting had a slide titled "Platform Options," and the first bullet was "Headless rebuild, 9 to 12 months." The product team had already started sketching a Next.js storefront. The site was a WooCommerce catalog for a Fortune 500 apparel brand, and on a mid-tier Android device over a throttled connection, a product page took 6.8 seconds to reach a usable Largest Contentful Paint. Nobody in the room could say which part of the stack was responsible. Everyone assumed it was WordPress itself.

I asked for two things before anyone signed off on a rewrite: a profile of a real product page under load, and a list of every active plugin with its owner and last update date. The list had 61 entries. Eleven of them hadn't been updated in over three years. Two were abandoned forks. That was the first clue. The second came out of the profile.

How I measured it

I don't trust a single Lighthouse run, and I don't trust a page speed score as a diagnosis. It's a symptom. What I want is a breakdown of where the time goes on the server and in the browser, measured the same way before and after every change.

  • Server side: Tideways on PHP 8.2 for request-level traces, plus Query Monitor on staging to count queries and identify the callers. I captured 200 requests per template, warm cache and cold.
  • Database: SELECT SUM(LENGTH(option_value)) FROM wp_options WHERE autoload = 'yes'. The answer was 14.2 MB. Every request loads all of that before it does anything useful.
  • Network and browser: WebPageTest from three regions, with throttling set to a mid-tier Android profile. I looked at TTFB and LCP separately, because they fail for different reasons.
  • Baseline: Median product page LCP at 6.8s, TTFB at 1.9s, 412 SQL queries per product page, and 38 outbound HTTP calls on a cold request.

Once I had those numbers, the picture got clearer fast. Three plugins accounted for roughly 70% of the PHP execution time and about 60% of the queries. The rest was ordinary background noise.

The three plugins doing the damage

1. A "related products" plugin running uncached meta queries

It was a reasonable idea: show shoppers products that share attributes with the current item. The implementation ran a meta_query with multiple LIKE clauses across wp_postmeta on every product view, with no transient, no object cache, and no index that could help. On a catalog of around 14,000 SKUs, that single query averaged 340 ms. It accounted for 180 of the 412 queries per page on its own.

The fix was to precompute the related IDs during a scheduled job, store them in a dedicated table keyed by product ID, and serve them with a single indexed read. The plugin stayed. Its query stopped being a per-request cost.

2. An analytics bridge making synchronous HTTP calls on init

This one sent a server-side event to a third-party endpoint on every request where a session cookie was present, using wp_remote_post with a 5-second timeout and no async handling. When the vendor's endpoint slowed down, which happened twice during the audit window, TTFB spiked across the entire site. The failure mode was subtle: the site didn't go down, it just got slower in proportion to someone else's infrastructure.

I moved the send to a queued job, added a circuit breaker that stops attempting for five minutes after three consecutive failures, and cut the timeout to 800 ms. The outbound call count on a cold request dropped from 38 to 9.

3. A page builder that enqueued its entire asset bundle everywhere

The builder loaded roughly 340 KB of CSS and JavaScript on every template, including the cart and checkout, where most of it was dead weight. Nothing was conditionally enqueued. The fix was tedious but mechanical: dequeue per template with wp_dequeue_style and wp_dequeue_script keyed by conditionals, and move the remaining scripts to defer. That alone moved LCP more than any server-side change, because the browser stopped blocking on assets that were never used on the page.

What I didn't touch

I left the theme alone. I didn't replace WooCommerce's cart fragments logic, which is annoying but not a bottleneck here. I didn't move to a different hosting tier until the numbers showed the database was the constraint, and it wasn't after the first two fixes. I kept Redis as an object cache, which we'd already configured, and I didn't tune it further until the profile said so.

The trade-off I accepted: the related-products table needs a nightly job, and if that job fails silently, shoppers see stale recommendations. I added a freshness check to the admin dashboard and an alert if the table hasn't been written in 26 hours. Operational cost is real. A rewrite would have moved that cost somewhere else, usually into a longer timeline with less visibility.

Results

  • Median product page LCP: 6.8s to 3.4s (roughly a 50% reduction)
  • TTFB on product pages: 1.9s to 0.4s
  • SQL queries per product page: 412 to 138
  • Autoloaded options: 14.2 MB to 1.1 MB, after moving three plugin-owned options to autoload = 'no' and purging expired transients
  • Outbound HTTP calls on cold requests: 38 to 9
  • Total engineering time: about 46 hours across three weeks, including staging validation

A 9-to-12-month headless rebuild would have cost multiples of that, and it would have carried its own failure modes: a new deploy pipeline, a preview environment to maintain, and a cache invalidation story that nobody on the team had yet written down.

What I'd do differently

I'd run the plugin inventory and the profiler on day one, before the kickoff deck exists. I spent the first two days arguing against a rewrite that the team had already half-decided on, when the profile would have made that argument for me. I'd also set up the autoload audit as a recurring check, not a one-time cleanup. Autoloaded bloat comes back every time someone installs a plugin that writes options with the default setting.

Most teams get this wrong because they treat a slow WordPress site as a platform problem. It almost never is. It's usually three components doing work they shouldn't, at times they shouldn't, and nobody has measured it.

Profile before you plan the migration, because the plugin that's costing you 70% of your load time is almost always one you already forgot you installed.

The discipline here is the same one we apply across Champlin Enterprises engagements: measure the system as it runs, fix the specific failure, and keep the change small enough that you can explain it to the next engineer. Our Champlin Enterprises work on WordPress and WooCommerce modernization follows that pattern, starting from production evidence rather than a preferred architecture.

Free Tool

See exactly what AI costs — across every provider.

MyTokenTracker is a free, multi-provider intelligence platform with live pricing across 100+ models. Compare Claude, GPT-4o, Gemini, and more side-by-side — built for developers evaluating models, teams tracking API spend, and founders building AI-native products who want to stay cost-aware before it becomes a line item worth explaining.