<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hamza Ahmad Aslam</title>
    <description>The latest articles on DEV Community by Hamza Ahmad Aslam (@hamzaahmadaslam).</description>
    <link>https://dev.to/hamzaahmadaslam</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4137796%2F26978a12-5676-40ea-8348-b649b0aac849.png</url>
      <title>DEV Community: Hamza Ahmad Aslam</title>
      <link>https://dev.to/hamzaahmadaslam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hamzaahmadaslam"/>
    <language>en</language>
    <item>
      <title>High-traffic WordPress architecture: the layers that carry the load</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sun, 29 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/high-traffic-wordpress-architecture-the-layers-that-carry-the-load-10no</link>
      <guid>https://dev.to/hamzaahmadaslam/high-traffic-wordpress-architecture-the-layers-that-carry-the-load-10no</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/high-traffic-wordpress-architecture" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt; For high traffic WordPress, the edge and full-page cache should absorb most anonymous page views before PHP runs. Capacity problems appear when too much traffic reaches PHP, the object cache, the database, search, or media processing at once. Design each layer so cacheable work stops early and uncached work has a measured budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  How high traffic WordPress requests move through the stack
&lt;/h2&gt;

&lt;p&gt;A useful WordPress architecture starts by separating edge work from origin work. The request path looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
  |
  v
CDN / edge cache
  |
  +--&amp;gt; full-page cache HIT --&amp;gt; response
  |
  +--&amp;gt; MISS or BYPASS
          |
          v
      PHP worker
          |
          +--&amp;gt; persistent object cache
          |
          +--&amp;gt; database writer / read replica
          |
          +--&amp;gt; search service
          |
          +--&amp;gt; media or external services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CDN terminates the public request close to the visitor and can serve static files or cached HTML. The full page cache is the main protection for PHP because a hit returns a completed response without bootstrapping WordPress. Scaling WordPress at this level is mostly about keeping requests in the cheapest eligible layer. WordPress VIP documents this pattern in its &lt;a href="https://docs.wpvip.com/caching/page-cache/" rel="noopener noreferrer"&gt;page cache architecture&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A page-cache miss consumes a PHP worker. That request may then read from a persistent object cache, query MySQL, call a search service, or fetch remote data. Each extra dependency adds latency and another capacity limit. The persistent object cache helps repeated application reads, but it does not replace full-page caching because PHP must already be running before WordPress can use it.&lt;/p&gt;

&lt;p&gt;Search and media should become separate services when their work is expensive. Search can move away from SQL matching, while media delivery can move away from PHP and the origin filesystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to design for cache hits
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Build cache keys around response identity
&lt;/h3&gt;

&lt;p&gt;A cache key must distinguish responses that differ.&lt;/p&gt;

&lt;p&gt;Common inputs are scheme, host, path, relevant query parameters, language, device variant, or a controlled personalization segment. Do not vary on a cookie merely because it exists. Every added dimension creates more cache entries and lowers reuse.&lt;/p&gt;

&lt;p&gt;Query strings are not automatically uncacheable. A cache may include the full query string in its key, ignore selected tracking parameters, or bypass certain parameters by policy. The danger is uncontrolled cardinality. If many unique parameter combinations reach origin, each can behave like a cold URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set TTLs and purge rules together
&lt;/h3&gt;

&lt;p&gt;TTL answers how long a cached response may live without invalidation. Purging answers how quickly a changed object should disappear before that TTL ends. Publishing or updating content should trigger targeted invalidation for the affected URL set when your cache layer supports it.&lt;/p&gt;

&lt;p&gt;Avoid treating purge-all as the normal publish path. A broad flush turns hot content cold at the same time and can move a traffic spike from the edge to PHP and MySQL. Prefer URL, tag, surrogate-key, or platform-specific invalidation where your stack supports it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make bypass rules explicit
&lt;/h3&gt;

&lt;p&gt;Logged-in sessions, personalized HTML, authorization headers, and state-changing requests normally belong at origin. Cookies only cause a bypass when your cache policy says they do. Personalization can also be cached when the number of variants is bounded and the cache can key those variants safely.&lt;/p&gt;

&lt;p&gt;WooCommerce documents that Cart, Checkout, and My Account should remain dynamic, and its &lt;a href="https://developer.woocommerce.com/docs/best-practices/performance/configuring-caching-plugins/" rel="noopener noreferrer"&gt;caching guidance&lt;/a&gt; calls out WooCommerce cookies that caching systems may need to exclude. Product and category pages are different: they are strong full-page-cache candidates when the rendered HTML is not customer-specific.&lt;/p&gt;

&lt;p&gt;This Nginx sketch shows the policy shape. The exact upstream, cache zone, cookie rules, and purge mechanism must match your environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;map&lt;/span&gt; $&lt;span class="n"&gt;http_cookie&lt;/span&gt; $&lt;span class="n"&gt;skip_page_cache&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="n"&gt;wordpress_logged_in_&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="n"&gt;woocommerce_items_in_cart&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="n"&gt;wp_woocommerce_session_&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;map&lt;/span&gt; $&lt;span class="n"&gt;query_string&lt;/span&gt; $&lt;span class="n"&gt;has_query_string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; \&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;$ &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fastcgi_cache&lt;/span&gt; &lt;span class="no"&gt;WORDPRESS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fastcgi_cache_methods&lt;/span&gt; &lt;span class="no"&gt;GET&lt;/span&gt; &lt;span class="no"&gt;HEAD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fastcgi_cache_key&lt;/span&gt; &lt;span class="s2"&gt;"$scheme$request_method$host$request_uri"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fastcgi_cache_bypass&lt;/span&gt; $&lt;span class="n"&gt;skip_page_cache&lt;/span&gt; $&lt;span class="n"&gt;has_query_string&lt;/span&gt; $&lt;span class="n"&gt;http_authorization&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fastcgi_no_cache&lt;/span&gt; $&lt;span class="n"&gt;skip_page_cache&lt;/span&gt; $&lt;span class="n"&gt;has_query_string&lt;/span&gt; $&lt;span class="n"&gt;http_authorization&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;# Let origin response headers or your cache policy define freshness.
&lt;/span&gt;
    &lt;span class="c1"&gt;# Existing fastcgi_pass and fastcgi_param directives belong here.
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nginx documents that &lt;code&gt;fastcgi_cache_bypass&lt;/code&gt; can prevent serving from cache and &lt;code&gt;fastcgi_no_cache&lt;/code&gt; can prevent saving the response. This example deliberately bypasses all query strings; a production policy can be more selective.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to budget traffic that reaches origin
&lt;/h2&gt;

&lt;p&gt;Your capacity model should start with requests per second that bypass the full-page cache, not total page views. The same public traffic level can produce very different origin load depending on cache hit ratio, user state, API use, and background work.&lt;/p&gt;

&lt;p&gt;Budget these paths separately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Treat logged-in page views as origin traffic unless the platform has a safe personalization cache.&lt;/li&gt;
&lt;li&gt;Treat &lt;code&gt;admin-ajax.php&lt;/code&gt; as application traffic. WordPress routes plugin AJAX requests through that endpoint, so each request can bootstrap WordPress and consume PHP time.&lt;/li&gt;
&lt;li&gt;Split REST traffic by behavior. Anonymous read endpoints may be cacheable at your edge, while authenticated or mutating requests must reach application code.&lt;/li&gt;
&lt;li&gt;Keep WooCommerce Cart, Checkout, and My Account dynamic. Test cart actions and Store API traffic separately from cached catalog pages.&lt;/li&gt;
&lt;li&gt;Treat site search as high-cardinality traffic unless you have a cache strategy for common queries.&lt;/li&gt;
&lt;li&gt;Account for WP-Cron and scheduled plugin work. WordPress checks scheduled tasks on page load, so background work can overlap with a traffic event.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each class, record arrival rate, PHP time, database time, external-call time, and error rate. Then verify that the combined uncached load fits inside worker, database, and downstream service capacity with room for bursts.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the database layer should scale
&lt;/h2&gt;

&lt;p&gt;Page caching lowers database demand more than any database tuning step because a page-cache hit avoids WordPress entirely. The next defense is the persistent object cache. WordPress core uses a non-persistent object cache by default, while a persistent drop-in can keep cached objects across requests.&lt;/p&gt;

&lt;p&gt;Read replicas help when a large share of database work is safe to serve from replicas. &lt;a href="https://github.com/Automattic/HyperDB" rel="noopener noreferrer"&gt;HyperDB&lt;/a&gt; is a &lt;code&gt;db.php&lt;/code&gt; drop-in that supports replication, failover, load balancing, and partitioning. LudicrousDB is another database drop-in with similar stated goals. Neither removes the need to design around replica lag or read-after-write behavior.&lt;/p&gt;

&lt;p&gt;Query discipline still matters. Avoid loading large result sets only to discard most of them in PHP. Request the fields, post types, statuses, and ordering the feature needs. Add indexes only after you inspect the actual query and execution plan.&lt;/p&gt;

&lt;p&gt;A normal &lt;code&gt;WP_Query&lt;/code&gt; should leave result caching enabled. The documented default for &lt;code&gt;cache_results&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;, and the related post meta and term cache flags also default to &lt;code&gt;true&lt;/code&gt;. The &lt;a href="https://developer.wordpress.org/reference/classes/wp_query/" rel="noopener noreferrer"&gt;WP_Query reference&lt;/a&gt; documents those cache controls.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WP_Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;'post_type'&lt;/span&gt;              &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'post'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'post_status'&lt;/span&gt;            &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'publish'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'orderby'&lt;/span&gt;                &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'order'&lt;/span&gt;                  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'DESC'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'cache_results'&lt;/span&gt;          &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'update_post_meta_cache'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'update_post_term_cache'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Search is a separate problem from transactional WordPress queries. Large relevance searches, faceting, and broad text matching can place expensive work on MySQL. A dedicated Elasticsearch or OpenSearch service can move search work away from MySQL. &lt;a href="https://github.com/10up/ElasticPress" rel="noopener noreferrer"&gt;ElasticPress&lt;/a&gt; is a WordPress integration for Elasticsearch. If you plan to use OpenSearch, confirm the exact plugin and server compatibility before deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  How media should leave the application path
&lt;/h2&gt;

&lt;p&gt;Do not make PHP read and stream ordinary image files during high load. Serve media from a CDN-backed store or platform media layer, with long-lived asset caching and versioned URLs where appropriate.&lt;/p&gt;

&lt;p&gt;Image resizing should also avoid becoming synchronous PHP work on a hot request. A managed image service or edge transformation layer can create and cache requested derivatives, while WordPress keeps attachment metadata and generates responsive markup. On WordPress VIP, the platform's image transformation service handles uploads through the VIP File System and serves transformed images through its CDN.&lt;/p&gt;

&lt;p&gt;Watch for two failure modes. First, a template can request many unique dimensions and create a large derivative set. Second, cache-busting media URLs can turn reusable images into repeated origin work. Keep size variants intentional and URLs stable.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to load test before traffic arrives
&lt;/h2&gt;

&lt;p&gt;WordPress load testing should reproduce the real split between cache hits and origin requests. A test that adds a unique query parameter to every request mainly measures bypass behavior. A test that only hits one warm URL mainly measures the cache.&lt;/p&gt;

&lt;p&gt;Use a staging environment that matches production architecture. If your hosting provider requires notice before a load test, follow that process. The script below expects one known cacheable path and one known uncached path. Do not point the uncached path at checkout, login, or a mutating endpoint unless the test data and side effects are controlled.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'k6/http'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sleep&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'k6'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;vus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;VUS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DURATION&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BASE_URL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cachedPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CACHED_PATH&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;uncachedPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UNCACHED_PATH&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${base}${cachedPath}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request_class&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'cached'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${base}${uncachedPath}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request_class&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'uncached'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__ENV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;THINK_TIME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with values chosen from your traffic model, not from a generic benchmark:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://staging.example.com"&lt;/span&gt; \
&lt;span class="nv"&gt;CACHED_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/"&lt;/span&gt; \
&lt;span class="nv"&gt;UNCACHED_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/your-known-uncached-route/"&lt;/span&gt; \
&lt;span class="nv"&gt;VUS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;your-vu-count&amp;gt;"&lt;/span&gt; \
&lt;span class="nv"&gt;DURATION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;your-duration&amp;gt;"&lt;/span&gt; \
&lt;span class="nv"&gt;THINK_TIME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;your-think-time-seconds&amp;gt;"&lt;/span&gt; \
k6 run high-traffic.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While it runs, watch edge hit ratio, origin request rate, PHP concurrency, worker queueing, database time, object-cache latency, search latency, external-call latency, and HTTP errors. Ramp gradually and stop when the system reaches your defined safety limit. The useful result is the first constrained layer, not a single requests-per-second headline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which numbers should observability keep visible
&lt;/h2&gt;

&lt;p&gt;Keep a small set of signals visible during a high traffic WordPress event:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track full-page cache hit ratio and the matching origin request rate.&lt;/li&gt;
&lt;li&gt;Track busy PHP workers, available worker capacity, and any queue or wait time.&lt;/li&gt;
&lt;li&gt;Track database time per request, slow-query volume, connection pressure, and replica health if replicas exist.&lt;/li&gt;
&lt;li&gt;Track object-cache hit ratio, latency, and evictions where your cache backend exposes them.&lt;/li&gt;
&lt;li&gt;Track HTTP error rate by status and route, especially for uncached endpoints.&lt;/li&gt;
&lt;li&gt;Track field Core Web Vitals, especially LCP, INP, and CLS, so backend success is not mistaken for a fast user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Correlate the layers. A falling cache hit ratio followed by PHP saturation and rising database time points to a different problem than stable origin load with worsening LCP.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;Map the request path first, then measure the uncached routes that can reach PHP. Use the &lt;a href="https://hamzaahmadaslam.com/blog/reduce-wordpress-ttfb" rel="noopener noreferrer"&gt;TTFB diagnostic guide&lt;/a&gt; to separate edge and origin delay, verify the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-redis-object-cache" rel="noopener noreferrer"&gt;WordPress Redis object cache setup&lt;/a&gt; when Redis is part of the stack, and check &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-php-workers" rel="noopener noreferrer"&gt;WordPress PHP worker capacity&lt;/a&gt; before raising concurrency. For platform-specific design and release constraints, review the &lt;a href="https://hamzaahmadaslam.com/services/wordpress-vip-development" rel="noopener noreferrer"&gt;WordPress VIP development service&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>architecture</category>
      <category>performance</category>
      <category>caching</category>
    </item>
    <item>
      <title>Website incident report template for WordPress outages</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sat, 28 Nov 2026 14:00:35 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/website-incident-report-template-for-wordpress-outages-2d5p</link>
      <guid>https://dev.to/hamzaahmadaslam/website-incident-report-template-for-wordpress-outages-2d5p</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/website-incident-report-template" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;A website incident report template should turn an outage into a record you can defend: what users were affected, when events happened, what evidence supports the cause, and who owns the fixes. For WordPress or WooCommerce, build the report from timestamped source records, keep hypotheses separate, and leave unknowns visible until evidence closes them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a website incident report template should include
&lt;/h2&gt;

&lt;p&gt;A useful report covers five things: impact, timeline, evidence, causal analysis, and follow-up work. Each section should make clear what is known, what is inferred, and what still needs checking.&lt;/p&gt;

&lt;p&gt;A practical post incident report template needs these fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify the incident, owner, date, affected function, and report status.&lt;/li&gt;
&lt;li&gt;Describe user impact using evidence rather than broad words such as "major" or "widespread."&lt;/li&gt;
&lt;li&gt;Record the incident timeline with one timezone and a source for each important event.&lt;/li&gt;
&lt;li&gt;List observations separately from hypotheses.&lt;/li&gt;
&lt;li&gt;Record unknowns that could change the analysis.&lt;/li&gt;
&lt;li&gt;Compare plausible alternative explanations before naming a cause.&lt;/li&gt;
&lt;li&gt;State the evidence that supports the final causal chain.&lt;/li&gt;
&lt;li&gt;Assign each preventive action to an owner.&lt;/li&gt;
&lt;li&gt;Give every action a verification procedure and an expected result.&lt;/li&gt;
&lt;li&gt;Keep a later verification record so "done" means more than a closed ticket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Detection itself belongs in your monitoring process. If that part needs work, use &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-uptime-monitoring" rel="noopener noreferrer"&gt;WordPress uptime monitoring checks that catch site failures&lt;/a&gt; rather than expanding the postmortem into another monitoring system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build the timeline from evidence rather than memory
&lt;/h2&gt;

&lt;p&gt;Start with the earliest source record you still have. That may be a monitoring event, deployment record, application log, support ticket, provider event, or incident chat timestamp.&lt;/p&gt;

&lt;p&gt;Use one timezone throughout the report. Keep the source beside the event so another person can trace the statement back to evidence.&lt;/p&gt;

&lt;p&gt;A timeline row should answer three questions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Timestamp&lt;/td&gt;
&lt;td&gt;When the source says the event happened&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event&lt;/td&gt;
&lt;td&gt;What is supported by that source&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence&lt;/td&gt;
&lt;td&gt;The log, alert, ticket, deploy record, screenshot, or other record supporting it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not rewrite uncertain events as facts. If you know a deployment finished at 14:02 but do not know when the first failed request occurred, record the deployment timestamp and leave the failure start unknown.&lt;/p&gt;

&lt;p&gt;The distinction matters because detection time, impact start, mitigation time, and confirmed recovery may be different events.&lt;/p&gt;

&lt;p&gt;For WordPress application errors, preserve logs that already exist. The &lt;a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/" rel="noopener noreferrer"&gt;WordPress debugging documentation&lt;/a&gt; says &lt;code&gt;WP_DEBUG_LOG&lt;/code&gt; can save errors to a log when &lt;code&gt;WP_DEBUG&lt;/code&gt; is enabled, and it advises using debugging tools in local or staging environments rather than directly on production.&lt;/p&gt;

&lt;p&gt;Do not enable extra production debugging after the incident and then imply that the resulting data describes the earlier failure. Record that historical evidence is unavailable if it was never captured.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate observations, hypotheses and unknowns
&lt;/h2&gt;

&lt;p&gt;An observation is something a source directly supports. A hypothesis is an explanation that still needs evidence.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Example wording&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;"The deployment record shows release X completed at 14:02 UTC."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;"The error record contains a fatal error at 14:04 UTC."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hypothesis&lt;/td&gt;
&lt;td&gt;"Release X may have introduced the failure."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unknown&lt;/td&gt;
&lt;td&gt;"The first affected request is not known because request-level records are unavailable."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alternative&lt;/td&gt;
&lt;td&gt;"A hosting or database event may have happened during the same window."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This structure prevents a common reporting mistake: placing the first plausible explanation into the "root cause" field and building the rest of the document around it.&lt;/p&gt;

&lt;p&gt;Keep alternatives until evidence rules them out. A deployment immediately before an outage is relevant evidence about timing, but timing alone does not show which code path failed.&lt;/p&gt;

&lt;p&gt;For WooCommerce stores, the &lt;a href="https://woocommerce.com/document/finding-php-error-logs/" rel="noopener noreferrer"&gt;WooCommerce PHP error log documentation&lt;/a&gt; says its fatal-error records can include a timestamp, error, originating file and line, and stack trace. That can connect an error to code, but you still need evidence that the error explains the affected user journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Describe impact with records you can point to
&lt;/h2&gt;

&lt;p&gt;Impact is what users or business processes could not do during the incident window. Keep this separate from the technical symptom.&lt;/p&gt;

&lt;p&gt;"PHP fatal error" is a technical observation. "Checkout could not complete" describes user impact.&lt;/p&gt;

&lt;p&gt;Record scope only as precisely as your evidence allows. Useful evidence can include failed request records, order records, support cases, transaction records, form submissions, monitoring history, and provider records.&lt;/p&gt;

&lt;p&gt;For a WooCommerce incident, save an environment snapshot while the configuration is still relevant. The &lt;a href="https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/" rel="noopener noreferrer"&gt;WooCommerce System Status report documentation&lt;/a&gt; describes a report containing environment details such as installed software versions, server information, database information, and WordPress debug state.&lt;/p&gt;

&lt;p&gt;Do not convert missing evidence into zero impact. Write "unknown" and state what would be needed to determine it.&lt;/p&gt;

&lt;p&gt;A missing order email also needs its own event-to-inbox investigation. Use the process for &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-order-emails-not-sending" rel="noopener noreferrer"&gt;tracing a missing WooCommerce order email&lt;/a&gt; rather than treating an absent email as proof that checkout itself failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trace the cause to the code or infrastructure level
&lt;/h2&gt;

&lt;p&gt;Root cause analysis should explain a causal chain, not stop at the first component with an error.&lt;/p&gt;

&lt;p&gt;Work from the supported symptom toward the smallest technical condition that explains it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the affected user action.&lt;/li&gt;
&lt;li&gt;Locate evidence from the same time window.&lt;/li&gt;
&lt;li&gt;Identify the component handling that action.&lt;/li&gt;
&lt;li&gt;Match errors or state changes to the component.&lt;/li&gt;
&lt;li&gt;Compare the timing with deployments, configuration changes, provider events, and infrastructure records.&lt;/li&gt;
&lt;li&gt;Write competing explanations.&lt;/li&gt;
&lt;li&gt;Remove an explanation only when evidence contradicts it or another cause accounts for the evidence better.&lt;/li&gt;
&lt;li&gt;Stop when the remaining causal chain explains both the failure and its timing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At code level, that may mean linking an error record to a specific file, line, call path, release, and input condition. At infrastructure level, it may mean connecting the request failure to the web server, PHP runtime, database, cache, network, or upstream service using records from those layers.&lt;/p&gt;

&lt;p&gt;Do not call a component the cause merely because it appears in a log. State what the record proves.&lt;/p&gt;

&lt;p&gt;For gateway failures, keep the detailed layer-by-layer investigation in &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-504-gateway-timeout" rel="noopener noreferrer"&gt;diagnosing WordPress 502 and 504 errors with request evidence&lt;/a&gt;. The incident report should contain the supported causal chain and link to the underlying evidence.&lt;/p&gt;

&lt;p&gt;If recovery involved restoring a backup, record exactly what was restored and from which backup set. WordPress documentation says a typical WordPress site needs both its &lt;a href="https://developer.wordpress.org/advanced-administration/security/backup/" rel="noopener noreferrer"&gt;database and files for a full restore&lt;/a&gt;. The report should record the recovery evidence rather than repeat the restore procedure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use this fictional WordPress incident as a reporting pattern
&lt;/h2&gt;

&lt;p&gt;The following incident is entirely fictional. Every name, timestamp, release, event and value is illustrative. It does not describe a client or an outage that occurred.&lt;/p&gt;

&lt;p&gt;Use the filled example to see how evidence, hypotheses and unknowns fit together. Use the editable template for any real incident you are documenting. If the report will be published or shared outside your organization, get consent from any client it names.&lt;/p&gt;

&lt;h3&gt;
  
  
  Illustrative fictional incident
&lt;/h3&gt;

&lt;p&gt;Illustrative scenario: A fictional WooCommerce store has a checkout failure shortly after an illustrative plugin deployment.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Illustrative timestamp&lt;/th&gt;
&lt;th&gt;Classification&lt;/th&gt;
&lt;th&gt;Illustrative record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-18 14:02 UTC&lt;/td&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;Deployment record lists fictional &lt;code&gt;Example Checkout Rules 2.4.0&lt;/code&gt; as completed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-18 14:04 UTC&lt;/td&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;Fictional application record contains a fatal error associated with the checkout request path.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-18 14:07 UTC&lt;/td&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;Fictional incident record marks checkout as affected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-18 14:15 UTC&lt;/td&gt;
&lt;td&gt;Observation&lt;/td&gt;
&lt;td&gt;Fictional deployment record lists rollback of &lt;code&gt;Example Checkout Rules 2.4.0&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-18 14:23 UTC&lt;/td&gt;
&lt;td&gt;Report boundary&lt;/td&gt;
&lt;td&gt;Illustrative incident window ends here for the example. This is sample data, not a measured result.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Illustrative impact: checkout completion is the affected user function in this fictional scenario. The number of affected shoppers, orders, and payment attempts remains unknown because this example supplies no transaction dataset.&lt;/p&gt;

&lt;p&gt;Illustrative hypothesis: the fictional plugin release introduced a checkout code path that generated the recorded fatal error.&lt;/p&gt;

&lt;p&gt;Illustrative alternative explanations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A hosting event may have coincided with the deployment.&lt;/li&gt;
&lt;li&gt;A database failure may have produced the same user symptom.&lt;/li&gt;
&lt;li&gt;An upstream payment dependency may have failed during the same period.&lt;/li&gt;
&lt;li&gt;Another code change may have been deployed in the same window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Illustrative evidence needed before confirming cause: correlate the fictional stack trace with the changed code, check other deployment records, compare host and database records for the same timestamps, and examine relevant payment-provider records.&lt;/p&gt;

&lt;p&gt;That wording keeps the cause open until the evidence supports one explanation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Editable incident report template
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# Incident: [plain description]
&lt;/span&gt;
Report status: [draft / under review / final]
Incident owner: [role or name]
Incident date: [date]
Timezone used: [timezone]
Affected function: [checkout / login / forms / pages / other]

&lt;span class="gu"&gt;## Impact
&lt;/span&gt;
User-visible impact:
[What users could not do.]

Confirmed scope:
[Evidence-supported scope, or "unknown".]

Business impact:
[Confirmed facts only, or "unknown".]

Data or security impact:
[Confirmed facts, "unknown", or a pointer to a separate security review.]

Evidence:
&lt;span class="k"&gt;- &lt;/span&gt;[source + timestamp + link/reference]
&lt;span class="k"&gt;- &lt;/span&gt;[source + timestamp + link/reference]

&lt;span class="gu"&gt;## Timeline
&lt;/span&gt;
| Timestamp | Observation or action | Evidence source |
|---|---|---|
| [time] | [source-supported event] | [record] |
| [time] | [source-supported event] | [record] |

&lt;span class="gu"&gt;## Observations
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[fact supported by source]
&lt;span class="k"&gt;- &lt;/span&gt;[fact supported by source]

&lt;span class="gu"&gt;## Hypotheses
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[possible explanation]
  &lt;span class="k"&gt;- &lt;/span&gt;Evidence for:
  &lt;span class="k"&gt;- &lt;/span&gt;Evidence against:
  &lt;span class="k"&gt;- &lt;/span&gt;Evidence still needed:

&lt;span class="gu"&gt;## Unknowns
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[question that remains open]
&lt;span class="k"&gt;- &lt;/span&gt;[missing evidence and why it matters]

&lt;span class="gu"&gt;## Alternative explanations
&lt;/span&gt;
| Explanation | Evidence needed | Status |
|---|---|---|
| [alternative] | [record or test needed] | [open / ruled out with evidence] |

&lt;span class="gu"&gt;## Supported causal chain
&lt;/span&gt;
[Describe only the sequence supported by evidence.
If the cause remains unknown, say so.]

&lt;span class="gu"&gt;## Recovery
&lt;/span&gt;
Mitigation or recovery action:
[What was changed.]

Recovery evidence:
[Record supporting recovery, or "not retained".]

&lt;span class="gu"&gt;## Preventive actions and verification
&lt;/span&gt;
| Action | Owner | Due | Verification procedure | Expected result | Verification record |
|---|---|---|---|---|---|
| [change] | [owner] | [date] | [procedure to run] | Expected: [result] | Pending |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Turn findings into owned actions and checks
&lt;/h2&gt;

&lt;p&gt;A corrective action needs a specific change, an owner, and a way to prove that the change works.&lt;/p&gt;

&lt;p&gt;"Improve testing" is too loose. Write the exact behavior that needs protection.&lt;/p&gt;

&lt;p&gt;For the fictional checkout scenario, illustrative follow-up rows might look like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Illustrative action&lt;/th&gt;
&lt;th&gt;Illustrative owner&lt;/th&gt;
&lt;th&gt;Verification procedure&lt;/th&gt;
&lt;th&gt;Expected result&lt;/th&gt;
&lt;th&gt;Verification record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Add a regression test for the fictional failing checkout path&lt;/td&gt;
&lt;td&gt;Developer&lt;/td&gt;
&lt;td&gt;Run the test against the corrected code in the test environment&lt;/td&gt;
&lt;td&gt;Expected: the checkout path completes without the fictional fatal error&lt;/td&gt;
&lt;td&gt;Pending&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add a release check for the affected checkout path&lt;/td&gt;
&lt;td&gt;Release owner&lt;/td&gt;
&lt;td&gt;Run the defined checkout check after a future deployment in the approved test environment&lt;/td&gt;
&lt;td&gt;Expected: the defined checkout flow reaches its expected completion state&lt;/td&gt;
&lt;td&gt;Pending&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Document the evidence needed for this incident class&lt;/td&gt;
&lt;td&gt;Maintenance owner&lt;/td&gt;
&lt;td&gt;Review the incident procedure against the required evidence fields&lt;/td&gt;
&lt;td&gt;Expected: each required evidence source has an owner or an explicit "unavailable" state&lt;/td&gt;
&lt;td&gt;Pending&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Automated tests belong in the postmortem when the finding maps to repeatable behavior. Unit, integration, or browser tests can protect different parts of the causal chain. The report should state the procedure and expected result, then add the actual verification record only after someone performs and records that work.&lt;/p&gt;

&lt;p&gt;A closed development ticket is not the same record as verification. Keep separate fields for implementation status and verification status.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the next incident report easier to verify
&lt;/h2&gt;

&lt;p&gt;Store the report beside its evidence references and schedule the open actions for review. If ongoing ownership, patching, incident follow-up, and verification need a defined maintainer, put those responsibilities into the scope of your &lt;a href="https://hamzaahmadaslam.com/services/wordpress-maintenance" rel="noopener noreferrer"&gt;WordPress maintenance service&lt;/a&gt; or internal maintenance agreement.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>monitoring</category>
      <category>incidentresponse</category>
    </item>
    <item>
      <title>WordPress malware removal cost: what a cleanup includes and when it costs more</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/wordpress-malware-removal-cost-what-a-cleanup-includes-and-when-it-costs-more-3kpj</link>
      <guid>https://dev.to/hamzaahmadaslam/wordpress-malware-removal-cost-what-a-cleanup-includes-and-when-it-costs-more-3kpj</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-malware-removal-cost" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;On November 13, 2026, a one-time cleanup of one hacked WordPress site cost $95 to $199 on the pricing pages compared below, and yearly security plans that include cleanup cost $299 to $1,250 per site. WordPress malware removal cost goes up with the number of sites, an infection that keeps coming back, a whole server or hosting account, and blacklist or Google warning removal.&lt;/p&gt;

&lt;h2&gt;
  
  
  WordPress malware removal cost on six pricing pages
&lt;/h2&gt;

&lt;p&gt;Every price below comes from the provider's own pricing page, read on November 13, 2026. Prices change, so check the page again before you pay. The tables quote each plan as the provider describes it.&lt;/p&gt;

&lt;h3&gt;
  
  
  One-time cleanups
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;Price as listed&lt;/th&gt;
&lt;th&gt;What the page says the price covers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;FixRunner&lt;/td&gt;
&lt;td&gt;WordPress Malware Removal Service&lt;/td&gt;
&lt;td&gt;$95 flat, one time&lt;/td&gt;
&lt;td&gt;Removal of all malware within 24 hours; you pay once you are satisfied; removing a Google warning costs $29 more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MD Pabel&lt;/td&gt;
&lt;td&gt;Malware removal + 30-day support&lt;/td&gt;
&lt;td&gt;$99, one site&lt;/td&gt;
&lt;td&gt;One manual cleanup, verification and 30 days of follow-up help&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MD Pabel&lt;/td&gt;
&lt;td&gt;Malware removal + 6-month support&lt;/td&gt;
&lt;td&gt;$199, one site&lt;/td&gt;
&lt;td&gt;One manual cleanup and six months of priority support for the same site&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WP Fix It&lt;/td&gt;
&lt;td&gt;WordPress Infection Removal&lt;/td&gt;
&lt;td&gt;$137 one time, one site ($97 per site for several)&lt;/td&gt;
&lt;td&gt;Files, database, backdoors, blacklist help, hardening and a report; repeat cleanups for 30 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SECURE WP&lt;/td&gt;
&lt;td&gt;Expert Malware Cleanup&lt;/td&gt;
&lt;td&gt;$149 one time, one site&lt;/td&gt;
&lt;td&gt;Root-cause investigation, file and database cleanup, backdoor removal, hardening, verification and a report; 12-month reinfection warranty; 30-day money-back guarantee&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Yearly plans that include cleanup
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;Price as listed&lt;/th&gt;
&lt;th&gt;What the page says the price covers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.malcare.com/pricing/" rel="noopener noreferrer"&gt;MalCare&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Repair&lt;/td&gt;
&lt;td&gt;$299 a year, 1 site ($899 for 5)&lt;/td&gt;
&lt;td&gt;Malware cleanup, a post-cleanup report, scans every 12 hours, expert response within 24 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MalCare&lt;/td&gt;
&lt;td&gt;Fortify&lt;/td&gt;
&lt;td&gt;$499 a year, 1 site ($1,499 for 5)&lt;/td&gt;
&lt;td&gt;Hourly scans, unlimited manual security fixes, expert response within 6 hours, recovery from a webhost suspension&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.wordfence.com/products/pricing/" rel="noopener noreferrer"&gt;Wordfence&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Care&lt;/td&gt;
&lt;td&gt;$590 a year&lt;/td&gt;
&lt;td&gt;Investigation and malware removal, blocklist removal and search engine cleanup after an incident, setup, yearly audit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wordfence&lt;/td&gt;
&lt;td&gt;Response&lt;/td&gt;
&lt;td&gt;$1,250 a year&lt;/td&gt;
&lt;td&gt;Everything in Care, plus incident response at any hour, a 1-hour response time and resolution within 24 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;MalCare shows prices in US dollars and says local pricing and offers are applied at checkout. Wordfence needs one license for each site, so a Care or Response price is per site.&lt;/p&gt;

&lt;h2&gt;
  
  
  One-time cleanup or a yearly plan
&lt;/h2&gt;

&lt;p&gt;A one-time cleanup pays for one job on one site. A yearly plan bundles cleanup with scanning, a firewall and a promised response time, and it renews every year.&lt;/p&gt;

&lt;p&gt;Read the plan name before you buy. MalCare's Protect plan ($99 a year) and Wordfence Premium ($149 a year) include scanning and a firewall but not malware removal. MalCare also offers a 14-day refund, except when it has already cleaned malware from the site in that time.&lt;/p&gt;

&lt;p&gt;If the site is hacked today, compare the one-time price with the first year of a plan. A plan keeps charging each year for scanning, a response time and any later cleanup, while a one-time price pays for this job alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a WordPress cleanup should include
&lt;/h2&gt;

&lt;p&gt;Two quotes at the same price can cover very different work. Hold each one against this list. A page that does not name an item may still do it, so ask.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A backup before any change. FixRunner says it makes a full backup first. MD Pabel says a current backup is created or confirmed before material changes.&lt;/li&gt;
&lt;li&gt;Files and the database. Malware can sit in theme and plugin files, in uploads, and in database content such as options and posts. WP Fix It and SECURE WP name both.&lt;/li&gt;
&lt;li&gt;Backdoors and anything that reinstalls the malware. A backdoor is a hidden way back in for the attacker. MD Pabel lists fake plugins, scheduled tasks, hidden users and self-restoring malware.&lt;/li&gt;
&lt;li&gt;The entry point. SECURE WP sells a root-cause investigation. Without it, the hole that let the attacker in stays open. The guide chapter &lt;a href="https://hamzaahmadaslam.com/guides/fix-hacked-wordpress-site/how-was-my-wordpress-site-hacked-chapter-6" rel="noopener noreferrer"&gt;How was my WordPress site hacked? Check the logs&lt;/a&gt; shows what that search looks like.&lt;/li&gt;
&lt;li&gt;A check after the cleanup. MD Pabel and SECURE WP both name verification.&lt;/li&gt;
&lt;li&gt;Hardening, a written report, and a reinfection window with a stated length.&lt;/li&gt;
&lt;li&gt;Help with blacklist or Google warnings, if the site has one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What makes a cleanup cost more
&lt;/h2&gt;

&lt;p&gt;Each listed price assumes one site and a standard infection. These are the reasons the pages above, and my own terms, give for a separate quote or a longer job.&lt;/p&gt;

&lt;h3&gt;
  
  
  More than one site
&lt;/h3&gt;

&lt;p&gt;MD Pabel quotes multiple websites separately. WP Fix It lists $97 per site when several sites are cleaned. Wordfence needs a license per site, and MalCare lists a separate price for 5 sites. A multisite network gets its own quote in my terms too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Malware that keeps coming back
&lt;/h3&gt;

&lt;p&gt;MD Pabel's FAQ says recurring malware usually means something was missed, such as a backdoor, a scheduled task, a hidden administrator or another infected site in the same hosting account. It also says persistent reinfections can take longer. My offer quotes repeated reinfection before work starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  A server or a whole hosting account
&lt;/h3&gt;

&lt;p&gt;When the infection spreads past one WordPress install, the job covers the server or every site in the account. My offer quotes a server separately. MD Pabel quotes connected hosting accounts and says a suspended hosting account can take longer. MalCare lists webhost suspension recovery only in its Fortify plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Blacklist and Google warning removal
&lt;/h3&gt;

&lt;p&gt;FixRunner charges $29 more to remove a Google warning. WP Fix It lists blacklist help as included, and Wordfence Care and Response list blocklist removal after an incident. Ask whether your quote includes it.&lt;/p&gt;

&lt;p&gt;For Google's warning, the site owner asks for a review with the Request Review button in Search Console's &lt;a href="https://support.google.com/webmasters/answer/9044101" rel="noopener noreferrer"&gt;Security Issues report&lt;/a&gt;, once every listed issue is fixed. Google says a review can take from a few days to a few weeks.&lt;/p&gt;

&lt;h3&gt;
  
  
  No working hosting access
&lt;/h3&gt;

&lt;p&gt;SECURE WP says most cases need WordPress administrator access plus hosting, SFTP, SSH or control panel access. My fixed price assumes working hosting access. If you are locked out of either, say so when you ask for a quote.&lt;/p&gt;

&lt;h3&gt;
  
  
  A staging site
&lt;/h3&gt;

&lt;p&gt;Wordfence charges $199 to add a staging site to the Care or Response audit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions to ask before you pay
&lt;/h2&gt;

&lt;p&gt;Copy these into your first email. A provider who answers all of them in writing has told you what the price buys.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What to ask&lt;/th&gt;
&lt;th&gt;A complete answer&lt;/th&gt;
&lt;th&gt;Why it matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Is the price fixed, and what does it exclude?&lt;/td&gt;
&lt;td&gt;A figure in writing, with the exclusions named&lt;/td&gt;
&lt;td&gt;A "from" price grows with what is found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Does it cover one site or the hosting account?&lt;/td&gt;
&lt;td&gt;Which sites and which account&lt;/td&gt;
&lt;td&gt;Every price in the tables above is per site&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Do you back up the site before changing anything?&lt;/td&gt;
&lt;td&gt;Yes, and where the backup is kept&lt;/td&gt;
&lt;td&gt;A cleanup that deletes the wrong file needs a way back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Do you clean the database as well as the files?&lt;/td&gt;
&lt;td&gt;Both, by name&lt;/td&gt;
&lt;td&gt;Injected scripts and spam can live in database content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Will you find and close the entry point?&lt;/td&gt;
&lt;td&gt;How you will look for it and what you will report&lt;/td&gt;
&lt;td&gt;An open entry point lets the attacker return&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What happens if it comes back, and for how long?&lt;/td&gt;
&lt;td&gt;The length, and whether it covers the same infection only&lt;/td&gt;
&lt;td&gt;Windows on the pages above run from 30 days to 12 months&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Is blacklist or Google warning removal included?&lt;/td&gt;
&lt;td&gt;Included, or the extra price&lt;/td&gt;
&lt;td&gt;FixRunner lists it at $29 extra&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How do I share access safely?&lt;/td&gt;
&lt;td&gt;A secure method, never email, chat or a contact form&lt;/td&gt;
&lt;td&gt;A password in an email or a form can be read by whoever sees it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Will I get a written report?&lt;/td&gt;
&lt;td&gt;What was found, removed and changed&lt;/td&gt;
&lt;td&gt;You need it to check the work and plan the next fix&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  When doing it yourself is reasonable
&lt;/h2&gt;

&lt;p&gt;Doing it yourself costs time instead of money. It is reasonable when you can log in to the hosting account, reach the files and the database, and follow a long procedure in order without skipping steps.&lt;/p&gt;

&lt;p&gt;The free guide &lt;a href="https://hamzaahmadaslam.com/guides/fix-hacked-wordpress-site" rel="noopener noreferrer"&gt;How to fix a hacked WordPress site step by step&lt;/a&gt; covers confirming the hack, preserving evidence, removing malware, closing the entry point, restoring search results and monitoring. The steps people skip are the ones that bring the malware back: finding the backdoor and the entry point, and checking the site after the cleanup.&lt;/p&gt;

&lt;p&gt;Once the site is clean, the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-security-hardening-checklist" rel="noopener noreferrer"&gt;WordPress security hardening checklist&lt;/a&gt; covers updates, logins, wp-config settings, upload rules and headers. Pay for help when several sites share one hosting account, or when the malware came back after an earlier cleanup.&lt;/p&gt;

&lt;h2&gt;
  
  
  What my fixed $99 cleanup covers
&lt;/h2&gt;

&lt;p&gt;Every enquiry starts with a free assessment. A standard cleanup of one site with working hosting access is a fixed $99, agreed with you after the assessment and before any work starts. A server, a multisite network or repeated reinfection gets a fixed quote before work starts. If the same infection comes back within 30 days of the cleanup, I clean it again free.&lt;/p&gt;

&lt;p&gt;The work runs in this order: assess, contain, clean, find the entry point, harden, then monitor. I check the WordPress files, themes, plugins and uploads for malicious files, modified code and injected scripts, and remove any mechanism that reinstalls the malware. Hardening can include a firewall or Cloudflare, file integrity checks, two-factor authentication, login limits, new passwords and salts, off-site backups and monitoring.&lt;/p&gt;

&lt;p&gt;Hardening lowers the chance of the same infection returning. It does not mean the site can never be hacked again, and the free re-clean covers the same infection only. To start, send the site URL and what you are seeing through my &lt;a href="https://hamzaahmadaslam.com/services/wordpress-malware-removal" rel="noopener noreferrer"&gt;WordPress malware removal and hacked site recovery&lt;/a&gt; page. Do not send passwords or hosting credentials through the form.&lt;/p&gt;

</description>
      <category>security</category>
      <category>wordpress</category>
      <category>incidentresponse</category>
      <category>hardening</category>
    </item>
    <item>
      <title>Migrating to WordPress VIP: a technical checklist</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/migrating-to-wordpress-vip-a-technical-checklist-50d8</link>
      <guid>https://dev.to/hamzaahmadaslam/migrating-to-wordpress-vip-a-technical-checklist-50d8</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-vip-migration" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt; A WordPress VIP migration is a staged move of code, database content, media, configuration, and launch operations onto VIP's deployment and runtime model. Audit platform incompatibilities first, fit the application into the VIP repository structure, import and test data on VIP, then switch traffic with a documented rollback path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should a WordPress VIP migration audit before code moves?
&lt;/h2&gt;

&lt;p&gt;Before you migrate to WordPress VIP, inventory anything that assumes a conventional single-server WordPress host. The biggest blockers are usually code that writes to local disk, duplicate infrastructure plugins, expensive database access, and background jobs built around host-specific cron.&lt;/p&gt;

&lt;p&gt;Start with every active, network-active, must-use, and code-activated plugin. Mark why it exists, who owns it, whether it changes storage or caching, and whether VIP already provides the function. VIP supplies a page cache, so page caching or generic server-performance plugins may be redundant or incompatible.&lt;/p&gt;

&lt;p&gt;File behavior needs its own pass. VIP web containers are read-only. Media under &lt;code&gt;/wp-content/uploads/&lt;/code&gt; is backed by the VIP File System, while temporary local work belongs in the system temporary directory. Any plugin that writes generated PHP, CSS, exports, lock files, or persistent local state needs review.&lt;/p&gt;

&lt;p&gt;Record all custom tables, their schema, indexes, growth pattern, and the queries that hit them. VIP supports custom tables, but migrations should expose missing indexes and table-creation routines before traffic reaches the new platform. Also identify direct SQL tied to an old table prefix or host-specific database behavior.&lt;/p&gt;

&lt;p&gt;List every scheduled event and external scheduler. VIP runs WordPress cron events through its Cron Control infrastructure, and the normal &lt;code&gt;/wp-cron.php&lt;/code&gt; request path is disabled on VIP. Confirm each recurring job can run through WordPress scheduling rather than a server crontab that will disappear after the move.&lt;/p&gt;

&lt;h2&gt;
  
  
  How should the VIP codebase be laid out?
&lt;/h2&gt;

&lt;p&gt;A WordPress application repository on VIP is based on the &lt;a href="https://docs.wpvip.com/wordpress-skeleton/" rel="noopener noreferrer"&gt;&lt;code&gt;vip-go-skeleton&lt;/code&gt;&lt;/a&gt;. The current VIP documentation lists seven required directories. A practical deploy-oriented tree looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;client-mu-plugins/
images/
languages/
plugins/
private/
themes/
vip-config/
docs/                 # optional
composer.json         # optional
composer.lock         # optional
.phpcs.xml.dist       # optional
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;themes/&lt;/code&gt; maps to the site's themes, while &lt;code&gt;plugins/&lt;/code&gt; contains regular plugins. Custom code that must load as an MU plugin belongs in &lt;code&gt;client-mu-plugins/&lt;/code&gt;. The &lt;code&gt;vip-config/&lt;/code&gt; directory holds application configuration that would commonly live in &lt;code&gt;wp-config.php&lt;/code&gt; on another host.&lt;/p&gt;

&lt;p&gt;Treat the VIP codebase as deployable application code, not a copy of an old &lt;code&gt;wp-content&lt;/code&gt; directory. Remove backup archives, cache directories, generated files, and host control files that are not part of the application. Files outside the supported root structure may not deploy as expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which code changes should happen before the first data import?
&lt;/h2&gt;

&lt;p&gt;Run the VIP PHPCS rules across the entire codebase early, before fixing files one by one. VIP documents the &lt;code&gt;WordPress-VIP-Go&lt;/code&gt; standard for local scans. With project-level PHPCS installed, the whole-repository command is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vendor/bin/phpcs --standard=WordPress-VIP-Go -sp --basepath=. --ignore=vendor .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The flags and standard above follow VIP's current &lt;a href="https://docs.wpvip.com/php_codesniffer/run-against-code/" rel="noopener noreferrer"&gt;PHPCS scan documentation&lt;/a&gt;. Treat the first report as an inventory. Fix platform errors first, then review warnings by risk, request frequency, and ownership.&lt;/p&gt;

&lt;p&gt;Typical migration changes include removing local filesystem assumptions, replacing redundant cache plugins, and correcting database access that cannot scale safely. Review code that writes on front-end requests, large uncached queries, repeated remote calls, and jobs that attempt too much work inside a normal web request.&lt;/p&gt;

&lt;p&gt;For custom tables, keep schema changes repeatable and versioned. VIP's current guidance permits custom tables and recommends WordPress's &lt;code&gt;dbDelta()&lt;/code&gt; for table upgrade routines. Check indexes against the actual reads and writes your application performs.&lt;/p&gt;

&lt;p&gt;Cron code should schedule named WordPress events and avoid depending on system cron entries from the old host. Test event registration, duplicate prevention, retry behavior, and idempotency. A migration is the wrong time to discover that a publishing feed only runs because an old server has a hidden crontab.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you import the database, media, and users?
&lt;/h2&gt;

&lt;p&gt;The VIP import work has two streams: SQL and media. Import SQL into a non-production environment first, validate the result, and repeat the process until it is predictable. Keep the final production import procedure identical except for the target environment and final source data.&lt;/p&gt;

&lt;p&gt;VIP-CLI can validate a local SQL file, run search-replace on that local file, and import the result. These commands match the current &lt;a href="https://docs.wpvip.com/vip-cli/commands/import/" rel="noopener noreferrer"&gt;&lt;code&gt;vip import&lt;/code&gt; command reference&lt;/a&gt; and &lt;a href="https://docs.wpvip.com/vip-cli/commands/search-replace/" rel="noopener noreferrer"&gt;&lt;code&gt;vip search-replace&lt;/code&gt; documentation&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vip import validate-sql migration.sql

vip search-replace migration.sql \
  --search-replace=&lt;span class="s2"&gt;"https://old.example.com,https://example.go-vip.net"&lt;/span&gt; \
  --output=migration-vip.sql

vip @example-app.develop import sql migration-vip.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use real source and target domains for the migration. Do not run a blind text replacement with a generic shell tool against a WordPress SQL dump. VIP-CLI's search-replace command exists specifically for a local SQL file and can write a separate output file for review.&lt;/p&gt;

&lt;p&gt;A full database import can include WordPress users and user metadata. After import, verify administrator access, editorial roles, multisite membership if applicable, password or SSO flows, and any integration that keys data by user ID. Keep at least one confirmed administrative path available before launch.&lt;/p&gt;

&lt;p&gt;Media uses a separate import path. The archive must contain an &lt;code&gt;uploads&lt;/code&gt; directory at its top level. VIP-CLI media imports target production, and production media is then shared with associated non-production environments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vip import validate-files /path/to/uploads

vip @example-app.production import media /path/to/uploads.tgz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Attachment records still live in the database. A file can exist in VIP storage without appearing correctly in the Media Library if the matching attachment data was not migrated. Test representative old and new media URLs after both data and files are in place.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should be tested before launch?
&lt;/h2&gt;

&lt;p&gt;Use at least one non-production VIP environment for acceptance and performance testing. VIP documents non-production as the place for code testing, and its platform architecture is closer to production than the local development environment for load and cache behavior.&lt;/p&gt;

&lt;p&gt;Test the workflows people depend on, not only page rendering. Cover editorial creation and publishing, previews, scheduled posts, media edits, search, feeds, forms, webhooks, SSO, APIs, redirects, email-triggering actions, and any syndication or import process. Include permissions for each editorial role.&lt;/p&gt;

&lt;p&gt;Performance tests should include cached and uncached routes, logged-out and authenticated flows, and endpoints that bypass page cache. Watch origin response time, slow queries, PHP errors, page cache hit rate, and object cache hit rate while test traffic runs. A fast cached homepage does not prove an uncached API or editor action is safe.&lt;/p&gt;

&lt;p&gt;Use a checklist with an owner and evidence for every gate:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Evidence before moving on&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Code audit&lt;/td&gt;
&lt;td&gt;Plugin and filesystem review complete&lt;/td&gt;
&lt;td&gt;Owners and replacement decisions recorded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code quality&lt;/td&gt;
&lt;td&gt;VIP PHPCS scan reviewed&lt;/td&gt;
&lt;td&gt;Blocking errors resolved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;SQL validation and repeat import pass&lt;/td&gt;
&lt;td&gt;Content, users, and settings verified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Media&lt;/td&gt;
&lt;td&gt;Import structure and URLs checked&lt;/td&gt;
&lt;td&gt;Representative attachments load&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Functional QA&lt;/td&gt;
&lt;td&gt;Editorial and integration flows pass&lt;/td&gt;
&lt;td&gt;Test cases signed off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Cache and origin behavior reviewed&lt;/td&gt;
&lt;td&gt;No unexplained errors or regressions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Launch&lt;/td&gt;
&lt;td&gt;DNS, TLS, redirects, freeze, rollback ready&lt;/td&gt;
&lt;td&gt;Named owner for each launch action&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Post-launch&lt;/td&gt;
&lt;td&gt;Logs and user journeys monitored&lt;/td&gt;
&lt;td&gt;Issues triaged against launch changes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What should happen on launch day?
&lt;/h2&gt;

&lt;p&gt;Turn the WordPress VIP migration runbook into a VIP launch checklist with exact owners, commands, domains, and stop conditions. Freeze content on the old site before the final data capture, or define a controlled delta process if a full freeze is impossible. Confirm the final database state before changing traffic.&lt;/p&gt;

&lt;p&gt;Verify the production domain is added and verified in VIP before cutover. Point DNS using the values shown in the VIP Dashboard, complete TLS provisioning, and test the final hostname. Keep redirects for retired paths and domain variants separate from the database URL replacement so each can be checked independently.&lt;/p&gt;

&lt;p&gt;The rollback plan must distinguish code, data, and traffic. Code on VIP deploys from the branch an environment tracks, so reverting code means deploying an earlier commit to that branch. That does not undo database changes, imported content, or DNS updates. Define what condition stops the launch, which DNS state you can restore, which data snapshot is authoritative, and who can make each change.&lt;/p&gt;

&lt;p&gt;During cutover, test the public site, WP Admin, authentication, publishing, forms, feeds, redirects, APIs, and key third-party callbacks from the production hostname. Avoid making unrelated feature changes during the same window. That keeps failures attributable to the migration steps you just performed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should be watched after traffic moves?
&lt;/h2&gt;

&lt;p&gt;Start with runtime errors and request behavior. Review VIP Runtime Logs, deployment events, slow queries, New Relic traces if enabled, and the Insights &amp;amp; Metrics panels for origin response codes and response time. Compare new errors with the exact deployment and launch timestamps.&lt;/p&gt;

&lt;p&gt;Watch both page cache and object cache hit rates. A cache drop can expose slow origin code that was hidden during acceptance testing. Investigate routes, cookies, query parameters, sessions, or application changes that cause avoidable cache bypasses before traffic pressure turns them into availability problems.&lt;/p&gt;

&lt;p&gt;Track user-facing performance as well as server metrics. Monitor field &lt;a href="https://web.dev/explore/learn-core-web-vitals" rel="noopener noreferrer"&gt;Core Web Vitals&lt;/a&gt; for LCP, INP, and CLS, and correlate regressions with templates, assets, third-party scripts, and backend response changes. Keep editorial feedback in the same launch triage process because admin regressions will not appear in public page metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;Before moving code, compare the migration findings against the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-vip-development-best-practices" rel="noopener noreferrer"&gt;WordPress VIP development guide&lt;/a&gt; and the &lt;a href="https://hamzaahmadaslam.com/blog/high-traffic-wordpress-architecture" rel="noopener noreferrer"&gt;high-traffic WordPress architecture guide&lt;/a&gt;. Use those reviews to turn each incompatibility into a code, data, or infrastructure task with an owner.&lt;/p&gt;

&lt;p&gt;For implementation support, use the &lt;a href="https://hamzaahmadaslam.com/services/wordpress-vip-development" rel="noopener noreferrer"&gt;WordPress VIP development service&lt;/a&gt;. After launch, put the site into the same operational cadence described in the &lt;a href="https://hamzaahmadaslam.com/blog/monitor-many-wordpress-sites" rel="noopener noreferrer"&gt;guide to monitoring WordPress sites&lt;/a&gt;, with errors, cache behavior, and user-facing performance reviewed together.&lt;/p&gt;

</description>
      <category>wordpressvip</category>
      <category>enterprise</category>
      <category>migration</category>
      <category>architecture</category>
    </item>
    <item>
      <title>WooCommerce product search slow: diagnose before adding a service</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Tue, 24 Nov 2026 14:00:30 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/woocommerce-product-search-slow-diagnose-before-adding-a-service-2kj6</link>
      <guid>https://dev.to/hamzaahmadaslam/woocommerce-product-search-slow-diagnose-before-adding-a-service-2kj6</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-product-search-slow" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;If WooCommerce product search feels slow, measure search quality and request time separately before replacing it. Use the same catalog and queries for every test, including exact names, typos, SKUs and a query that should return nothing. Then inspect which request, query and plugin produced the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  When WooCommerce product search is slow, separate speed from relevance
&lt;/h2&gt;

&lt;p&gt;A search can be fast and wrong. It can also return the right product after an unacceptable delay. Treat those as separate failures.&lt;/p&gt;

&lt;p&gt;Use two measures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relevance: did the expected products appear, and did stronger matches appear before weaker ones?&lt;/li&gt;
&lt;li&gt;Latency: how long did the search request take across repeated runs?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the test conditions stable while diagnosing. Then compare them with production search data if you collect it. The distinction is similar to the one web.dev makes between &lt;a href="https://web.dev/articles/lab-and-field-data-differences" rel="noopener noreferrer"&gt;controlled lab measurements and field data&lt;/a&gt;: repeatable tests isolate changes, while field data includes varied devices, networks and user behavior.&lt;/p&gt;

&lt;p&gt;Do not assume the result order is simply "whatever WooCommerce returns." If a search reaches ordinary WordPress &lt;code&gt;WP_Query&lt;/code&gt;, WordPress searches the post title, excerpt and content by default. Search queries also default to relevance ordering unless another &lt;code&gt;orderby&lt;/code&gt; value is supplied. The current &lt;a href="https://developer.wordpress.org/reference/classes/wp_query/" rel="noopener noreferrer"&gt;&lt;code&gt;WP_Query&lt;/code&gt; reference&lt;/a&gt; documents both behaviors.&lt;/p&gt;

&lt;p&gt;A theme, WooCommerce extension or search plugin can change that path. Your first job is to establish which path your store uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build representative queries before changing search
&lt;/h2&gt;

&lt;p&gt;A useful test set represents how people identify products. One exact-name query does not tell you whether typo handling, SKU lookup, empty results or broad terms work.&lt;/p&gt;

&lt;p&gt;The synthetic fixture below is illustrative. Every name, identifier, query, scenario, score and timing is illustrative rather than a measured store result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a small illustrative catalog
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sample row&lt;/th&gt;
&lt;th&gt;Sample product&lt;/th&gt;
&lt;th&gt;Sample product data&lt;/th&gt;
&lt;th&gt;Reason for including it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Row A, illustrative&lt;/td&gt;
&lt;td&gt;Atlas Running Shoe, illustrative name&lt;/td&gt;
&lt;td&gt;SKU &lt;code&gt;ARS-100&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Strong exact-name and broad-term match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row B, illustrative&lt;/td&gt;
&lt;td&gt;Atlas Shoe Care Kit, illustrative name&lt;/td&gt;
&lt;td&gt;SKU &lt;code&gt;ASK-200&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Weaker "Atlas" match that tests ordering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row C, illustrative&lt;/td&gt;
&lt;td&gt;Summit Fleece, illustrative name&lt;/td&gt;
&lt;td&gt;Parent SKU &lt;code&gt;SF-300&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Tests parent SKU lookup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row D, illustrative&lt;/td&gt;
&lt;td&gt;Summit Fleece, Blue Medium variation, illustrative name&lt;/td&gt;
&lt;td&gt;Variation SKU &lt;code&gt;SF-300-BLU-M&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Tests variation SKU handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row E, illustrative&lt;/td&gt;
&lt;td&gt;Wireless Studio Headphones, illustrative name&lt;/td&gt;
&lt;td&gt;SKU &lt;code&gt;WSH-410&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Target for the typo case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row F, illustrative&lt;/td&gt;
&lt;td&gt;Canvas Tote, illustrative name&lt;/td&gt;
&lt;td&gt;SKU &lt;code&gt;CT-500&lt;/code&gt;, illustrative identifier&lt;/td&gt;
&lt;td&gt;Unrelated product that should stay out of narrow searches&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Create an equivalent fixture on staging, or select a fixed production subset without changing it during the comparison.&lt;/p&gt;

&lt;p&gt;WooCommerce allows individual variations to have an SKU. If a variation SKU is left blank, it uses the product-level SKU. That distinction matters when testing WooCommerce search SKU behavior, so verify where the identifier is stored using the &lt;a href="https://woocommerce.com/document/variable-product/" rel="noopener noreferrer"&gt;variable product documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the same illustrative query matrix every time
&lt;/h3&gt;

&lt;p&gt;This synthetic test assumes typo tolerance and SKU lookup are requirements for the example store. Your expected behavior should reflect your own search contract.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Query&lt;/th&gt;
&lt;th&gt;Expected result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exact-name scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Atlas Running Shoe&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Atlas Running Shoe, illustrative item, should be the top result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Normal keyword scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;running shoe&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Atlas Running Shoe, illustrative item, should rank ahead of unrelated items&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Broad-term scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;atlas&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Both Atlas products, illustrative items, may qualify; record their intended order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typo scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;wireles headphones&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Wireless Studio Headphones, illustrative item, should appear because typo recovery is an illustrative requirement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parent-SKU scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;SF-300&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Summit Fleece, illustrative item, should be findable if parent SKU search is enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Variation-SKU scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;SF-300-BLU-M&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Summit Fleece variation, illustrative item, should be findable if variation SKUs are in scope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No-result scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ceramic espresso grinder&lt;/code&gt;, illustrative query&lt;/td&gt;
&lt;td&gt;Expected zero products in the illustrative catalog&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep the queries unchanged when comparing the existing setup with a configuration change or another search implementation. Never declare a plugin winner from one query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Score WooCommerce search relevance separately
&lt;/h2&gt;

&lt;p&gt;Define the expected product before you run each query. Otherwise it is easy to move the goalposts after seeing the results.&lt;/p&gt;

&lt;p&gt;Use this illustrative rubric:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Illustrative definition&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;3&lt;/code&gt;, illustrative points&lt;/td&gt;
&lt;td&gt;Expected product is the top result, or the no-result query returns zero products&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;2&lt;/code&gt;, illustrative points&lt;/td&gt;
&lt;td&gt;Expected product appears near the top, but a weaker match precedes it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;1&lt;/code&gt;, illustrative point&lt;/td&gt;
&lt;td&gt;Expected product appears, but weak matches make it hard to find&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt;, illustrative points&lt;/td&gt;
&lt;td&gt;Expected product is missing, or the no-result query returns unrelated products&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use one visible calculation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ILLUSTRATIVE_MAX_POINTS_PER_QUERY = 3
ILLUSTRATIVE_PERCENT_SCALE = 100

relevance_percent =
    earned_points
    / (scored_queries * ILLUSTRATIVE_MAX_POINTS_PER_QUERY)
    * ILLUSTRATIVE_PERCENT_SCALE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the individual query scores beside the total. An average can hide one serious failure, such as exact SKU searches returning nothing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does WooCommerce product search return irrelevant products?
&lt;/h3&gt;

&lt;p&gt;First determine which fields and ranking rules your implementation uses. Core WordPress search has its own relevance ordering, but plugins can replace or alter both matching and sorting.&lt;/p&gt;

&lt;p&gt;For example, the paid, third-party &lt;a href="https://woocommerce.com/products/woocommerce-product-search/" rel="noopener noreferrer"&gt;WooCommerce Product Search extension&lt;/a&gt;, developed by itthinx and sold on the Woo Marketplace, lets its Product Search Field search titles, excerpts, content, categories, tags, attributes and SKUs. It also provides ordering controls. These are features of that extension, not a statement about native WooCommerce search behavior.&lt;/p&gt;

&lt;p&gt;Compare the fields that produced each unwanted match with the fields your store intends to search. Change one rule at a time, then rerun the complete matrix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure a latency distribution instead of one request
&lt;/h2&gt;

&lt;p&gt;For each query, capture the network request used by the live search or submitted results page. Repeat the same query several times under the same controlled conditions.&lt;/p&gt;

&lt;p&gt;Record the first request separately from later requests if caching may affect the path. Keep raw values rather than recording only the fastest run.&lt;/p&gt;

&lt;p&gt;This synthetic distribution exists only to show the worksheet format. Every timing below is an illustrative expected worksheet value, not a performance target or benchmark.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Repeated request times&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;Slowest&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exact-name scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;180 ms&lt;/code&gt;, &lt;code&gt;190 ms&lt;/code&gt;, &lt;code&gt;205 ms&lt;/code&gt;, &lt;code&gt;220 ms&lt;/code&gt;, &lt;code&gt;250 ms&lt;/code&gt;, all illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;205 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;250 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typo scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;210 ms&lt;/code&gt;, &lt;code&gt;225 ms&lt;/code&gt;, &lt;code&gt;230 ms&lt;/code&gt;, &lt;code&gt;260 ms&lt;/code&gt;, &lt;code&gt;310 ms&lt;/code&gt;, all illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;230 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;310 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SKU scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;190 ms&lt;/code&gt;, &lt;code&gt;200 ms&lt;/code&gt;, &lt;code&gt;215 ms&lt;/code&gt;, &lt;code&gt;245 ms&lt;/code&gt;, &lt;code&gt;280 ms&lt;/code&gt;, all illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;215 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;280 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No-result scenario, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;170 ms&lt;/code&gt;, &lt;code&gt;175 ms&lt;/code&gt;, &lt;code&gt;180 ms&lt;/code&gt;, &lt;code&gt;195 ms&lt;/code&gt;, &lt;code&gt;220 ms&lt;/code&gt;, all illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;180 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;220 ms&lt;/code&gt;, illustrative&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Replace every illustrative value with your own measurements. Compare distributions before and after each change. Do not treat one unusually fast request as proof that the problem is fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect the request and plugin behavior
&lt;/h2&gt;

&lt;p&gt;Once you know which queries fail, trace only those cases. This keeps a relevance problem from turning into a broad database tuning exercise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why can a no-match search return every product?
&lt;/h3&gt;

&lt;p&gt;Treat this as a query-path problem first.&lt;/p&gt;

&lt;p&gt;Open the browser Network panel and submit the no-result query from your matrix. Record the request URL, parameters, response and the component that sent it.&lt;/p&gt;

&lt;p&gt;Standard WordPress keyword search uses the &lt;code&gt;s&lt;/code&gt; query variable, but a search plugin may define its own request format. If the term disappears before the server-side search receives it, find the theme or plugin code responsible for building that request.&lt;/p&gt;

&lt;p&gt;If the term reaches the search implementation, check its documented empty-query and no-result behavior. A fallback supplied by an extension can look like a successful search even though the original query matched nothing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why can AJAX results differ from the results page?
&lt;/h3&gt;

&lt;p&gt;Compare the live-search request with the submitted search-results request as two separate paths.&lt;/p&gt;

&lt;p&gt;Record the search term, endpoint, searchable fields, product scope and ordering for each. Live search may be produced by an extension while the results page follows another query path. Even one different sort setting can produce different ordering from the same text.&lt;/p&gt;

&lt;p&gt;Do not fix the mismatch by tuning whichever screen you happen to be looking at. Decide which behavior is expected, then make both paths follow that contract.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why can an existing SKU fail to appear?
&lt;/h3&gt;

&lt;p&gt;Check the product first. Confirm that the SKU you tested is stored on the parent product or on a variation, then confirm that your chosen search implementation documents support for that location.&lt;/p&gt;

&lt;p&gt;Also check catalog visibility. WooCommerce documents &lt;code&gt;Shop and search&lt;/code&gt; as the default catalog visibility. &lt;code&gt;Shop only&lt;/code&gt; excludes a product from search, while &lt;code&gt;Hidden&lt;/code&gt; excludes it from catalog listings and search. The current &lt;a href="https://woocommerce.com/document/managing-products/product-editor-settings/" rel="noopener noreferrer"&gt;product visibility documentation&lt;/a&gt; gives the exact choices.&lt;/p&gt;

&lt;p&gt;A successful admin lookup does not prove that the storefront search uses the same fields or query path. Test the storefront itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inspect the database query only after finding the request
&lt;/h3&gt;

&lt;p&gt;If the server request is the slow part, reproduce it on staging and inspect the database work it triggers.&lt;/p&gt;

&lt;p&gt;WordPress documents &lt;code&gt;SAVEQUERIES&lt;/code&gt; for this purpose. When enabled, it stores queries, their execution times and calling functions in &lt;code&gt;$wpdb-&amp;gt;queries&lt;/code&gt;. The &lt;a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/" rel="noopener noreferrer"&gt;WordPress debugging documentation&lt;/a&gt; also warns that it has a performance cost and recommends debugging tools on local or staging environments rather than live sites.&lt;/p&gt;

&lt;p&gt;Look for the query or plugin component whose cost changes with the failing search. Do not start rewriting unrelated database queries simply because the store is large.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the smallest bounded improvement
&lt;/h2&gt;

&lt;p&gt;Use the evidence from the same matrix after each change.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Smallest next change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Relevance fails but latency is acceptable&lt;/td&gt;
&lt;td&gt;Adjust searchable fields, weights, typo rules or synonyms that the current implementation already supports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exact SKU works but variation SKU fails&lt;/td&gt;
&lt;td&gt;Add or configure variation-SKU coverage if the implementation supports it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No-result query returns the full catalog&lt;/td&gt;
&lt;td&gt;Fix the request, empty-query handling or fallback before changing ranking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Live search and the results page disagree&lt;/td&gt;
&lt;td&gt;Align their query scope and ordering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relevance is acceptable but server latency is poor&lt;/td&gt;
&lt;td&gt;Diagnose the responsible server request and database query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Both measures remain outside your own acceptance criteria after bounded fixes&lt;/td&gt;
&lt;td&gt;Compare a dedicated search service against the same catalog, matrix and measurement method&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A required capability is absent from the current implementation&lt;/td&gt;
&lt;td&gt;Evaluate an implementation that explicitly documents that capability&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There is no useful universal catalog-size threshold for moving to a separate service. The decision comes from your required features, repeatable relevance failures and latency distribution.&lt;/p&gt;

&lt;p&gt;A separate search service becomes a testable option when the current implementation cannot meet those requirements after you have isolated the query path and tried bounded changes. Run the same matrix against any candidate rather than comparing demos or one favorable query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the evidence for the next fix
&lt;/h2&gt;

&lt;p&gt;If the search request itself points to expensive SQL, continue with the guide to &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-slow-database-queries" rel="noopener noreferrer"&gt;find and fix slow WordPress database queries&lt;/a&gt; rather than widening this search diagnosis into general database work.&lt;/p&gt;

&lt;p&gt;If the measured problem crosses several WooCommerce request paths and needs hands-on profiling, &lt;a href="https://hamzaahmadaslam.com/services/woocommerce-speed-optimization" rel="noopener noreferrer"&gt;WooCommerce speed optimization&lt;/a&gt; is the relevant service path. If search is fast but choosing attributes on the product page is slow, keep that separate and diagnose &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-variation-dropdown-slow" rel="noopener noreferrer"&gt;why a WooCommerce variation selector feels slow&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>woocommerce</category>
      <category>performance</category>
      <category>database</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Headless WordPress examples and architectural patterns</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sun, 22 Nov 2026 14:00:30 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/headless-wordpress-examples-and-architectural-patterns-4i4e</link>
      <guid>https://dev.to/hamzaahmadaslam/headless-wordpress-examples-and-architectural-patterns-4i4e</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/headless-wordpress-examples" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt; Practical headless WordPress examples divide the platform into two separate systems: WordPress acting solely as a structured content repository, and an external frontend framework rendering the user interface. Typical production architectures include static publishing pipelines built with modern site generators, dynamic corporate portals using Next.js, and mobile applications consuming the native REST API or WPGraphQL. Decoupling the presentation layer isolates administrative operations and eliminates theme constraints, though it requires managing two hosting stacks and custom cache invalidation pipelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core architectures behind headless WordPress examples
&lt;/h2&gt;

&lt;p&gt;Decoupling WordPress means disabling or ignoring the traditional PHP template hierarchy (such as &lt;code&gt;single.php&lt;/code&gt; or &lt;code&gt;archive.php&lt;/code&gt;). The WordPress application handles user authentication, custom post types, editorial revisions, and database storage, while an independent client queries the data over HTTP as JSON.&lt;/p&gt;

&lt;p&gt;Real deployments typically fall into three patterns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Static site generation with incremental updates: WordPress runs on an internal server or private subdomain. An external static generator builds HTML files at deploy time and re-renders individual pages when editors publish changes.&lt;/li&gt;
&lt;li&gt;Dynamic server-side rendering: A Node.js or edge runtime generates HTML for every request, pulling fresh content from the WordPress API with server-side caching layers.&lt;/li&gt;
&lt;li&gt;Native and omnichannel applications: WordPress is the central editorial backend, exposing endpoints to iOS and Android applications, digital signage, and single-page web applications simultaneously.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each setup alters the operational burden. When deciding whether decoupling matches your organisation, reviewing the architectural assessment in &lt;a href="https://hamzaahmadaslam.com/blog/headless-wordpress-nextjs" rel="noopener noreferrer"&gt;headless WordPress with Next.js: when it fits&lt;/a&gt; helps clarify the development costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 1: Editorial publishing with static regeneration
&lt;/h2&gt;

&lt;p&gt;A classic pattern involves high-traffic blogs and news rooms where content changes frequently throughout the editorial day, but visitors require instant page loads. In this model, editors write in the block editor on &lt;code&gt;admin.example.com&lt;/code&gt;, while visitors access static HTML cached across a global content delivery network on &lt;code&gt;example.com&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The publishing flow
&lt;/h3&gt;

&lt;p&gt;The hosting environment runs WordPress behind basic authentication or an IP allowlist. When an editor clicks publish, WordPress fires an action hook that sends an HTTP POST request to a webhook endpoint on a platform such as Vercel or Cloudflare Pages.&lt;/p&gt;

&lt;p&gt;Here is how you register a lightweight webhook trigger in your child theme or custom plugin using &lt;code&gt;save_post&lt;/code&gt; in WordPress 6.x:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;span class="k"&gt;declare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strict_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'save_post'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'prefix_trigger_build_webhook'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;prefix_trigger_build_webhook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$post_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;WP_Post&lt;/span&gt; &lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nv"&gt;$update&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Ignore auto-drafts, revisions, and non-public updates&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;wp_is_post_revision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$post_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;wp_is_post_autosave&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$post_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;post_status&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'publish'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nv"&gt;$webhook_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defined&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'FRONTEND_BUILD_HOOK'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="no"&gt;FRONTEND_BUILD_HOOK&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;$api_secret&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defined&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'BUILD_SECRET_TOKEN'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="no"&gt;BUILD_SECRET_TOKEN&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$webhook_url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nf"&gt;wp_remote_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$webhook_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'timeout'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'blocking'&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'headers'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'Content-Type'&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'Authorization'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Bearer '&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$api_secret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'body'&lt;/span&gt;      &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;wp_json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'post_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$post_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'slug'&lt;/span&gt;    &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;post_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'type'&lt;/span&gt;    &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;post_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this static architecture, visitors receive pre-built HTML, CSS and compressed images instead of triggering WordPress database queries and PHP execution for each page view.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 2: Enterprise technical documentation and knowledge base
&lt;/h2&gt;

&lt;p&gt;Companies often select WordPress because non-technical teams already know how to format content, manage taxonomies, and schedule releases. However, product documentation often requires advanced client-side search, custom code syntax engines, and integration with Git-based versioning.&lt;/p&gt;

&lt;p&gt;In a headless documentation setup, teams configure WordPress custom post types for articles, guides, and API references. The frontend application fetches content via the &lt;a href="https://developer.wordpress.org/rest-api/" rel="noopener noreferrer"&gt;WordPress REST API&lt;/a&gt; and pipes the markdown or HTML through modern layout engines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Search indexing integration
&lt;/h3&gt;

&lt;p&gt;Instead of relying on MySQL &lt;code&gt;LIKE&lt;/code&gt; queries or heavy search plugins inside the WordPress dashboard, a headless architecture offloads document indexing to external search engines like Meilisearch, Typesense, or Algolia. A WordPress hook pushes clean post content to the search index upon publishing. The frontend executes client-side search requests straight to the search engine, returning results in milliseconds without touching the origin server.&lt;/p&gt;

&lt;p&gt;Separating the presentation also strengthens your perimeter. Securing your database and admin endpoints becomes simpler when public traffic never touches your PHP environment directly, as covered in our &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-security-hardening-checklist" rel="noopener noreferrer"&gt;WordPress security hardening checklist&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 3: Omnichannel content distribution
&lt;/h2&gt;

&lt;p&gt;When content must reach desktop browsers, mobile apps, and point-of-sale displays at the same time, maintaining separate CMS engines creates duplicate work. In this pattern, WordPress operates as a headless data warehouse.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Frontend Target&lt;/th&gt;
&lt;th&gt;Delivery Format&lt;/th&gt;
&lt;th&gt;Query Strategy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Web Application&lt;/td&gt;
&lt;td&gt;Server-Rendered HTML&lt;/td&gt;
&lt;td&gt;WPGraphQL with edge cache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;iOS / Android App&lt;/td&gt;
&lt;td&gt;Native JSON Views&lt;/td&gt;
&lt;td&gt;REST API with JWT authentication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-Store Display&lt;/td&gt;
&lt;td&gt;Static Asset Bundles&lt;/td&gt;
&lt;td&gt;Polling REST API via cron&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Using WPGraphQL allows client developers to request exact data shapes. For example, a mobile device checking for a daily notification might request only the post title, permalink, and an excerpt, avoiding the transmission of large HTML blobs over cellular networks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="nc"&gt;GetLatestAnnouncements&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;categoryName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Announcements"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;nodes&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;databaseId&lt;/span&gt;
      &lt;span class="n"&gt;title&lt;/span&gt;
      &lt;span class="n"&gt;date&lt;/span&gt;
      &lt;span class="n"&gt;excerpt&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure decouples release cycles. Frontend teams can redesign native components and publish app updates without modifying underlying WordPress databases, custom post types, or editorial workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to setup headless WordPress: core steps
&lt;/h2&gt;

&lt;p&gt;Setting up a headless instance requires preparing WordPress to work cleanly as an API origin rather than a website engine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Redirect frontend requests
&lt;/h3&gt;

&lt;p&gt;Prevent visitors and search bots from indexing default themes or accessing empty template pages on your backend domain. Add this snippet to a custom plugin or your active functions file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;span class="k"&gt;declare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strict_types&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'template_redirect'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'prefix_disable_public_frontend'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;prefix_disable_public_frontend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Allow API endpoints, cron jobs, and admin requests to continue&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;is_admin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;wp_is_json_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;defined&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'DOING_CRON'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="no"&gt;DOING_CRON&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Redirect visitors hitting root URLs to the admin dashboard or external site&lt;/span&gt;
    &lt;span class="nf"&gt;wp_safe_redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;admin_url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;301&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Cross-Origin Resource Sharing (CORS)
&lt;/h3&gt;

&lt;p&gt;If your decoupled frontend runs on &lt;code&gt;example.com&lt;/code&gt; and your WordPress installation resides on &lt;code&gt;cms.example.com&lt;/code&gt;, browsers block JavaScript fetch requests by default. You must configure explicit headers in your web server. On Nginx, specify your permitted origin within the server configuration block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;wp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;if ($request_method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'OPTIONS'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="s1"&gt;'Access-Control-Allow-Origin'&lt;/span&gt; &lt;span class="s1"&gt;'https://example.com'&lt;/span&gt; &lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="s1"&gt;'Access-Control-Allow-Methods'&lt;/span&gt; &lt;span class="s1"&gt;'GET, POST, OPTIONS'&lt;/span&gt; &lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="s1"&gt;'Access-Control-Allow-Headers'&lt;/span&gt; &lt;span class="s1"&gt;'Authorization, Content-Type'&lt;/span&gt; &lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="s1"&gt;'Access-Control-Max-Age'&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;204&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="s1"&gt;'Access-Control-Allow-Origin'&lt;/span&gt; &lt;span class="s1"&gt;'https://example.com'&lt;/span&gt; &lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;try_files&lt;/span&gt; $&lt;span class="n"&gt;uri&lt;/span&gt; $&lt;span class="n"&gt;uri&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;$&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Configure frontend data retrieval
&lt;/h3&gt;

&lt;p&gt;In your modern application layer, create a reliable fetch helper. If you are building with Next.js, use native fetch with revalidation tags, as described in the &lt;a href="https://nextjs.org/docs" rel="noopener noreferrer"&gt;Next.js data fetching documentation&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;PostSummary&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rendered&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rendered&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getPostBySlug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;PostSummary&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`https://cms.example.com/wp-json/wp/v2/posts?slug=${encodeURIComponent(slug)}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sb"&gt;`post-${slug}`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revalidate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;PostSummary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Backend performance and caching trade-offs
&lt;/h2&gt;

&lt;p&gt;Moving to headless changes where latency occurs. Traditional WordPress sites rely on page caching plugins that save fully generated HTML on disk. When you switch to an API-first approach, your frontend application continuously requests JSON data from the backend.&lt;/p&gt;

&lt;p&gt;Without preparation, this increases database load because complex REST API or GraphQL queries must repeatedly resolve post metadata, taxonomy terms, and user permissions. &lt;/p&gt;

&lt;p&gt;To keep API responses fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install a persistent cache: Store query results in memory instead of reading from MySQL on every request. Follow the configuration steps in our guide on &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-redis-object-cache" rel="noopener noreferrer"&gt;WordPress Redis object cache setup&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Cache safe public JSON responses at the edge: Limit caching to anonymous public &lt;code&gt;GET&lt;/code&gt; responses, with explicit bypasses for authenticated, preview, cart, checkout and other session-sensitive requests. See &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-rest-api-performance" rel="noopener noreferrer"&gt;WordPress REST API performance&lt;/a&gt; for the public versus authenticated boundary and &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-cdn-caching" rel="noopener noreferrer"&gt;WordPress CDN caching&lt;/a&gt; for cache rules.&lt;/li&gt;
&lt;li&gt;Monitor origin response latency: If your Node.js server takes hundreds of milliseconds simply awaiting JSON responses from WordPress, read our guide on &lt;a href="https://hamzaahmadaslam.com/blog/reduce-wordpress-ttfb" rel="noopener noreferrer"&gt;how to reduce WordPress TTFB&lt;/a&gt; to isolate backend bottlenecks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Decoupled setups do not solve slow backend code automatically. If your database queries are poorly indexed or your &lt;code&gt;wp_options&lt;/code&gt; table is bloated, your API responses will drag down build times and dynamic rendering routines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common pitfalls in headless WordPress projects
&lt;/h2&gt;

&lt;p&gt;Before separating your stack, account for the capabilities that traditional themes manage automatically.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Draft previews break easily: WordPress expects to display drafts on its internal URL. Building a preview system requires creating a signed token route in your frontend application that retrieves unpublished content safely.&lt;/li&gt;
&lt;li&gt;SEO and metadata management: Plugins like Yoast or Rank Math populate &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tags automatically in standard themes. In a headless environment, you must install companion plugins that expose SEO meta fields over the REST API or WPGraphQL, then manually map those fields to your frontend layout components.&lt;/li&gt;
&lt;li&gt;Visual editor parity: Content authors expect the block editor to match their site styles. A decoupled frontend means you must either recreate your design system styles inside the WordPress admin editor, or editors will work in an unstyled visual environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your organization needs bespoke user experiences, native mobile delivery, or strict isolation between marketing editors and internal servers, these headless WordPress examples show architecture patterns and trade-offs to evaluate.&lt;/p&gt;

&lt;p&gt;If you need help architecting, securing, or optimizing a headless WordPress implementation, &lt;a href="https://hamzaahmadaslam.com/#contact" rel="noopener noreferrer"&gt;get in touch to discuss your project&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>headlesswordpress</category>
      <category>restapi</category>
      <category>wpgraphql</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Shopify script tag deprecation: find what stops working on March 1, 2027</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sat, 21 Nov 2026 14:00:30 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/shopify-script-tag-deprecation-find-what-stops-working-on-march-1-2027-54j1</link>
      <guid>https://dev.to/hamzaahmadaslam/shopify-script-tag-deprecation-find-what-stops-working-on-march-1-2027-54j1</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/shopify-script-tag-deprecation" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;Shopify script tag deprecation means apps that still load storefront code through the old ScriptTag API will stop doing so on March 1, 2027. You can find the affected scripts in your storefront's page source, match them to installed apps and check whether each replacement is active before the deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes on March 1, 2027?
&lt;/h2&gt;

&lt;p&gt;Shopify will stop injecting script tags into storefront pages on March 1, 2027. If your reviews, chat, pop-ups or another feature still depends on one, that feature will stop loading. Your Shopify admin will not necessarily show an error.&lt;/p&gt;

&lt;p&gt;A script tag lets an app load JavaScript without editing theme code. Shopify introduced theme app extensions as the replacement in 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://shopify.dev/changelog/posts/online-store-script-tags-deprecation" rel="noopener noreferrer"&gt;Shopify's changelog post of August 24, 2026&lt;/a&gt; and its developer guides establish these dates:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;What changes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;August 28, 2025&lt;/td&gt;
&lt;td&gt;Script tags stop running on the Order status page for Shopify Plus stores.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;August 26, 2026&lt;/td&gt;
&lt;td&gt;Script tags stop running on the Order status page for all other stores.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;October 1, 2026&lt;/td&gt;
&lt;td&gt;Apps can no longer create or update script tags on any Admin API version. Existing tags keep running.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;March 1, 2027&lt;/td&gt;
&lt;td&gt;Shopify stops injecting script tags into storefronts. Features still depending on them stop loading.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The October restriction affects GraphQL &lt;code&gt;scriptTagCreate&lt;/code&gt; and &lt;code&gt;scriptTagUpdate&lt;/code&gt;, plus REST &lt;code&gt;POST&lt;/code&gt; and &lt;code&gt;PUT&lt;/code&gt;. Older API versions cannot bypass it.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;scriptTags&lt;/code&gt; query and &lt;code&gt;scriptTagDelete&lt;/code&gt; mutation remain available for audits and cleanup.&lt;/p&gt;

&lt;p&gt;The storefront deadline also applies to vintage themes. App embed replacements support vintage and Online Store 2.0 themes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How common are old Shopify script tags?
&lt;/h2&gt;

&lt;p&gt;On November 1, 2026 I checked the public home pages of 206 Shopify storefronts, one request each, reading the script tag list Shopify prints in each page; 120 of them still loaded at least one script tag. It is one day's sample, so read it as a sign of how common this still is, not as a measurement of all stores.&lt;/p&gt;

&lt;p&gt;A script tag's presence does not prove that its feature will break. The app might already have a working replacement while its old tag remains installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you find script tags on your Shopify store?
&lt;/h2&gt;

&lt;p&gt;You can check a public storefront using a desktop browser. You do not need an API token or access to theme code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open your live storefront
&lt;/h3&gt;

&lt;p&gt;Open your store's public home page in a desktop browser.&lt;/p&gt;

&lt;p&gt;Use a logged-out session so you see what customers see. A password-protected store shows its password page instead. Use an authorized session to inspect the actual storefront.&lt;/p&gt;

&lt;p&gt;Check the published theme rather than an unpublished preview.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: View the page source
&lt;/h3&gt;

&lt;p&gt;Right-click the page and choose View page source.&lt;/p&gt;

&lt;p&gt;You can also use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows or Linux: &lt;code&gt;Ctrl+U&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;macOS Chrome: &lt;code&gt;Cmd+Option+U&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The browser opens a tab containing the HTML returned by the server. Use this instead of the Elements panel in developer tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Search for asyncLoad
&lt;/h3&gt;

&lt;p&gt;Use your browser's Find command and search for:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;asyncLoad&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Look for a block containing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var urls = [&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Read the web addresses inside the list. Each represents a script tag Shopify is injecting into that page.&lt;/p&gt;

&lt;p&gt;The domain often identifies the vendor. The &lt;code&gt;?shop=&lt;/code&gt; parameter commonly contains your store's &lt;code&gt;.myshopify.com&lt;/code&gt; address.&lt;/p&gt;

&lt;p&gt;Some addresses contain &lt;code&gt;\/&lt;/code&gt; instead of &lt;code&gt;/&lt;/code&gt;, or &lt;code&gt;\u0026&lt;/code&gt; instead of &lt;code&gt;&amp;amp;&lt;/code&gt;. These are escaped characters in the page source. They do not change the domain.&lt;/p&gt;

&lt;p&gt;If there is no &lt;code&gt;asyncLoad&lt;/code&gt; block, this check finds no injected script tags on that page. Other JavaScript can still run through theme code or app extensions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Separate old script tags from app embeds
&lt;/h3&gt;

&lt;p&gt;Only the addresses inside the &lt;code&gt;var urls&lt;/code&gt; list are the script tags identified by this inspection method.&lt;/p&gt;

&lt;p&gt;Script files elsewhere in the page load through other methods and are not affected by this change. App embed files, for example, commonly use &lt;code&gt;cdn.shopify.com&lt;/code&gt; addresses containing &lt;code&gt;/extensions/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Shopify documents that theme app extension assets are hosted on its CDN. The &lt;code&gt;/extensions/&lt;/code&gt; address pattern is something you can observe in page source, not a guaranteed URL format from Shopify's documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Match each domain to an installed app
&lt;/h3&gt;

&lt;p&gt;In Shopify admin:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Settings &amp;gt; Apps.&lt;/li&gt;
&lt;li&gt;Review the installed apps.&lt;/li&gt;
&lt;li&gt;Compare their names and vendors with your script domains.&lt;/li&gt;
&lt;li&gt;Open each likely app's details or Shopify App Store listing.&lt;/li&gt;
&lt;li&gt;Contact the app's support team if you cannot identify a domain.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, &lt;code&gt;example-reviews.example&lt;/code&gt; might belong to a reviews app. That domain is an illustrative placeholder.&lt;/p&gt;

&lt;p&gt;A matching domain is a clue, not proof. Some apps host scripts through separate companies.&lt;/p&gt;

&lt;p&gt;Shopify scopes script tags to the app that created them. Uninstalling an app automatically removes its tags. Every address still injected through the list therefore belongs to an installed app.&lt;/p&gt;

&lt;p&gt;Recently uninstalled apps matter when investigating theme code left behind, rather than active ScriptTag records.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you make a script tag inventory?
&lt;/h2&gt;

&lt;p&gt;Copy this table into a document or spreadsheet. Record one row per address.&lt;/p&gt;

&lt;p&gt;All rows, domains and app names below are illustrative examples.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Script address (domain)&lt;/th&gt;
&lt;th&gt;App or vendor&lt;/th&gt;
&lt;th&gt;Still used?&lt;/th&gt;
&lt;th&gt;Replacement&lt;/th&gt;
&lt;th&gt;Done on published theme?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;example-reviews.example (illustrative)&lt;/td&gt;
&lt;td&gt;Example Reviews&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;App embed&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;example-chat.example (illustrative)&lt;/td&gt;
&lt;td&gt;Example Chat&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;App embed&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;example-tracking.example (illustrative)&lt;/td&gt;
&lt;td&gt;Example Tracking&lt;/td&gt;
&lt;td&gt;Unknown&lt;/td&gt;
&lt;td&gt;Web pixel&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For each row, keep the full URL alongside the domain. A developer may need it to identify the exact record.&lt;/p&gt;

&lt;p&gt;Use the final column to record whether the replacement works on the published storefront. Web pixels do not require a theme-editor activation step.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should replace each script tag?
&lt;/h2&gt;

&lt;p&gt;The replacement depends on what the code does. Shopify explains the available approaches in its &lt;a href="https://shopify.dev/docs/apps/build/online-store/script-tag-deprecation/storefront" rel="noopener noreferrer"&gt;storefront migration documentation&lt;/a&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the script does&lt;/th&gt;
&lt;th&gt;Replacement&lt;/th&gt;
&lt;th&gt;Who handles it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Displays reviews, chat, pop-ups, badges or other storefront features&lt;/td&gt;
&lt;td&gt;App embed block in a theme app extension&lt;/td&gt;
&lt;td&gt;App developer builds it; merchant activates it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collects only analytics or conversion events&lt;/td&gt;
&lt;td&gt;Web pixel&lt;/td&gt;
&lt;td&gt;App developer implements it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sends events to a service without a supported app&lt;/td&gt;
&lt;td&gt;Custom pixel&lt;/td&gt;
&lt;td&gt;Merchant or developer maintains it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Belongs to an app the store no longer needs&lt;/td&gt;
&lt;td&gt;Uninstall the app&lt;/td&gt;
&lt;td&gt;Store owner or manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Belongs to an admin-created custom app that cannot use extensions&lt;/td&gt;
&lt;td&gt;Move into theme code or replace the app&lt;/td&gt;
&lt;td&gt;Developer or service provider&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An app embed can also load JavaScript without displaying a visible widget.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you activate a Shopify app embed?
&lt;/h3&gt;

&lt;p&gt;App embeds start disabled after installation. An app cannot activate one automatically for the merchant.&lt;/p&gt;

&lt;p&gt;To enable a replacement:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Online Store in Shopify admin.&lt;/li&gt;
&lt;li&gt;Select Edit theme for the published theme.&lt;/li&gt;
&lt;li&gt;Select the App embeds icon in the editor sidebar.&lt;/li&gt;
&lt;li&gt;Find the replacement app's embed.&lt;/li&gt;
&lt;li&gt;Turn its toggle on.&lt;/li&gt;
&lt;li&gt;Select Save.&lt;/li&gt;
&lt;li&gt;Check the feature on the live storefront.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These steps follow &lt;a href="https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/apps" rel="noopener noreferrer"&gt;Shopify's theme app embed instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the embed is missing, ask the vendor whether its app supports the replacement.&lt;/p&gt;

&lt;p&gt;App embeds are enabled per theme. Before publishing another theme, open its App embeds panel and activate the required embeds. Market configurations can also have their own app embed settings, so check those where applicable.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if the script only tracks visitors or purchases?
&lt;/h3&gt;

&lt;p&gt;Use the vendor's web pixel replacement when available. Web pixels collect customer events without requiring activation in the theme editor.&lt;/p&gt;

&lt;p&gt;If no suitable app pixel exists, a developer can consider a custom pixel under Settings &amp;gt; Customer events.&lt;/p&gt;

&lt;p&gt;Shopify says adding and using custom pixels is unsupported by Shopify. Some pixel code does not work in the pixel sandbox, so the third-party vendor may need to help.&lt;/p&gt;

&lt;p&gt;Remove or modify previous tracking code, including code in &lt;code&gt;theme.liquid&lt;/code&gt;, to avoid counting events twice. Follow &lt;a href="https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage" rel="noopener noreferrer"&gt;Shopify's custom pixel instructions&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should you avoid running both versions?
&lt;/h3&gt;

&lt;p&gt;Before March 1, 2027, the old tag can run alongside its replacement.&lt;/p&gt;

&lt;p&gt;If both execute the same functionality, analytics events might be counted twice or a widget might appear twice.&lt;/p&gt;

&lt;p&gt;Keep the old feature working until its replacement is ready. Then have the responsible app remove its old tag.&lt;/p&gt;

&lt;p&gt;After the deadline, leftover script tag records no longer load storefront code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can a developer audit script tags?
&lt;/h2&gt;

&lt;p&gt;An agency can extract addresses from the storefront, then query the Admin API for an app it maintains.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the storefront with curl
&lt;/h3&gt;

&lt;p&gt;Run this command in a shell with &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;sed&lt;/code&gt; available. Replace the example domain with the live store.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://your-store.com/ &lt;span class="o"&gt;|&lt;/span&gt; grep -o &lt;span class="s1"&gt;'var urls = \[[^]]*\]'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; grep -oE &lt;span class="s1"&gt;'https?:[^"]+'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sed &lt;span class="s1"&gt;'s|\\/|/|g'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It extracts addresses from the &lt;code&gt;var urls&lt;/code&gt; list and unescapes slashes. Some addresses retain &lt;code&gt;\u0026&lt;/code&gt; where the page has &lt;code&gt;&amp;amp;&lt;/code&gt;; the domain stays readable.&lt;/p&gt;

&lt;p&gt;Empty output means the command found no matching list. Check the page manually before concluding there are no tags. A password page or changed HTML format can also produce an empty result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Query script tags through the Admin API
&lt;/h3&gt;

&lt;p&gt;For an app your agency maintains, run this GraphQL Admin API query using that app's authenticated session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;scriptTags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;nodes&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;id&lt;/span&gt;
      &lt;span class="n"&gt;src&lt;/span&gt;
      &lt;span class="n"&gt;displayScope&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;pageInfo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;hasNextPage&lt;/span&gt;
      &lt;span class="n"&gt;endCursor&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;src&lt;/code&gt; gives the address, &lt;code&gt;displayScope&lt;/code&gt; identifies where the tag was intended to load and &lt;code&gt;id&lt;/code&gt; identifies the record.&lt;/p&gt;

&lt;p&gt;The query requests up to 50 records. If &lt;code&gt;hasNextPage&lt;/code&gt; is true, fetch the next page using &lt;code&gt;after&lt;/code&gt; with the returned &lt;code&gt;endCursor&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The query returns only tags accessible to that app, not every app's tags on the store.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://shopify.dev/docs/api/admin-graphql/latest/queries/scriptTags" rel="noopener noreferrer"&gt;official scriptTags reference&lt;/a&gt; documents its arguments and fields.&lt;/p&gt;

&lt;p&gt;Once the replacement works, the app developer can use &lt;code&gt;scriptTagDelete&lt;/code&gt; to remove the old record. This operation requires the appropriate script tag access.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you do with scripts nobody owns?
&lt;/h2&gt;

&lt;p&gt;Unknown ownership needs investigation before removal.&lt;/p&gt;

&lt;h3&gt;
  
  
  An installed app is no longer used
&lt;/h3&gt;

&lt;p&gt;Ask whether the business still needs its features. Check for connections to tracking, customers or store operations before uninstalling.&lt;/p&gt;

&lt;p&gt;Uninstalling removes the app's script tags. Some apps leave theme code behind, so check the app listing or support instructions for additional cleanup.&lt;/p&gt;

&lt;p&gt;Make code changes on a duplicate theme, not the live theme.&lt;/p&gt;

&lt;h3&gt;
  
  
  An old agency created a custom app
&lt;/h3&gt;

&lt;p&gt;Some stores use admin-created custom apps for outside services or older integrations.&lt;/p&gt;

&lt;p&gt;These apps cannot use Shopify app extensions or web pixels. Whoever maintains the integration must move its storefront script into the theme, using a custom Liquid block where possible or the code editor otherwise.&lt;/p&gt;

&lt;p&gt;Editing theme code takes the theme off its automatic upgrade path. The service can instead supply a replacement app that supports extensions.&lt;/p&gt;

&lt;h3&gt;
  
  
  No installed app matches the domain
&lt;/h3&gt;

&lt;p&gt;Contact likely vendors through Settings &amp;gt; Apps. Send the full script address and ask whether their app owns it.&lt;/p&gt;

&lt;p&gt;Ask what replacement they provide and whether it needs activation.&lt;/p&gt;

&lt;p&gt;Avoid deleting unfamiliar code until you know its purpose.&lt;/p&gt;

&lt;p&gt;For help identifying owners and coordinating replacements, the &lt;a href="https://hamzaahmadaslam.com/services/shopify-script-tag-migration" rel="noopener noreferrer"&gt;Shopify script tag audit and cleanup service&lt;/a&gt; covers this work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should you check if Shopify script tags stop working?
&lt;/h2&gt;

&lt;p&gt;If a widget disappears, check its app status, the published theme's App embeds panel and the storefront's &lt;code&gt;asyncLoad&lt;/code&gt; list.&lt;/p&gt;

&lt;p&gt;Before March 1, 2027, a failure can come from the app, theme settings or another integration issue.&lt;/p&gt;

&lt;p&gt;After the deadline, check whether the app has supplied a replacement and whether the merchant activated it.&lt;/p&gt;

&lt;p&gt;For analytics, verify events using the vendor's supported testing tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the migration checklist?
&lt;/h2&gt;

&lt;p&gt;Use this checklist for each store you maintain.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Open the live storefront and find the &lt;code&gt;asyncLoad&lt;/code&gt; script tag addresses.&lt;/li&gt;
&lt;li&gt;[ ] Record each domain, full URL and suspected app in the inventory table.&lt;/li&gt;
&lt;li&gt;[ ] Match every script to an installed app or confirm its owner with support.&lt;/li&gt;
&lt;li&gt;[ ] Decide whether the feature is still required and which replacement it needs.&lt;/li&gt;
&lt;li&gt;[ ] Ask the vendor or developer to prepare the replacement without disabling the working feature prematurely.&lt;/li&gt;
&lt;li&gt;[ ] Activate required app embeds on the published theme and check any other theme scheduled for publication.&lt;/li&gt;
&lt;li&gt;[ ] Verify each widget or tracking feature, then have the responsible app remove its old script tag where appropriate.&lt;/li&gt;
&lt;li&gt;[ ] Check the storefront page source again after the changes to confirm the expected old addresses are gone.&lt;/li&gt;
&lt;li&gt;[ ] Repeat the storefront and feature checks on or after March 1, 2027.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What should you check after removing the old scripts?
&lt;/h2&gt;

&lt;p&gt;Check that required widgets work and analytics events are not duplicated.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href="https://hamzaahmadaslam.com/tools/core-web-vitals-budget" rel="noopener noreferrer"&gt;Core Web Vitals budget calculator&lt;/a&gt; to plan loading and interaction budgets if replacement scripts add JavaScript work.&lt;/p&gt;

&lt;p&gt;Compare field data with lab measurements using the guide to &lt;a href="https://hamzaahmadaslam.com/blog/pagespeed-good-core-web-vitals-failed" rel="noopener noreferrer"&gt;why PageSpeed can look good while Core Web Vitals fail&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Keep the completed inventory with the store's maintenance records.&lt;/p&gt;

</description>
      <category>migration</category>
      <category>javascript</category>
      <category>integration</category>
      <category>troubleshooting</category>
    </item>
    <item>
      <title>Diagnose a WordPress 504 gateway timeout and 502 errors with evidence</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Thu, 19 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/diagnose-a-wordpress-504-gateway-timeout-and-502-errors-with-evidence-3lb1</link>
      <guid>https://dev.to/hamzaahmadaslam/diagnose-a-wordpress-504-gateway-timeout-and-502-errors-with-evidence-3lb1</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-504-gateway-timeout" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;A WordPress 504 gateway timeout means a gateway or proxy timed out while connecting to an upstream, sending it a request, or waiting for its response. Start by recording one failing request with an exact timestamp and timezone, then trace that same request through the edge, web proxy and PHP logs. A WordPress 502 bad gateway needs the same path, but HTTP defines it as an invalid upstream response rather than a response that arrived too late.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a WordPress 504 gateway timeout proves, and what it does not
&lt;/h2&gt;

&lt;p&gt;HTTP 502 and 504 describe what a gateway saw while talking to another server. &lt;a href="https://www.rfc-editor.org/rfc/rfc9110.html" rel="noopener noreferrer"&gt;RFC 9110 defines 502&lt;/a&gt; as an invalid response from an inbound server, while 504 means the gateway did not receive a timely response from an upstream server.&lt;/p&gt;

&lt;p&gt;That tells you where to start, not what caused the incident. The slow or unavailable upstream might be PHP-FPM, another web server, a service behind a CDN, or a dependency reached while PHP handles the request.&lt;/p&gt;

&lt;p&gt;On Nginx with PHP-FPM, three waits matter. &lt;code&gt;fastcgi_connect_timeout&lt;/code&gt; covers establishing the FastCGI connection. &lt;code&gt;fastcgi_send_timeout&lt;/code&gt; covers the interval between successive writes while Nginx transmits the request. &lt;code&gt;fastcgi_read_timeout&lt;/code&gt; covers the interval between successive reads from FastCGI.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html" rel="noopener noreferrer"&gt;Nginx FastCGI documentation&lt;/a&gt; lists a 60-second default for all three directives, but your host can override them. The send and read values are inactivity intervals between write or read operations, not whole-request deadlines.&lt;/p&gt;

&lt;p&gt;When one of these upstream timeout failures becomes the final response, Nginx maps it to 504. The Nginx error log tells you which stage timed out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;while connecting to upstream&lt;/code&gt; means Nginx did not establish the upstream connection.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;while sending request to upstream&lt;/code&gt; means the connection was established, but Nginx could not finish transmitting the request.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;while reading response header from upstream&lt;/code&gt; means Nginx established the connection and finished sending enough to wait for the response header.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last two cases prove a connection existed. They do not prove a PHP-FPM worker had started the request. A connected socket can still wait in PHP-FPM's listen backlog while all workers are busy.&lt;/p&gt;

&lt;p&gt;Connection refusal, a missing Unix socket, or no live upstream is a different path and normally becomes 502 if that failure is final. One Linux Unix-socket case needs separate treatment: a full listen queue can make &lt;code&gt;connect()&lt;/code&gt; fail with &lt;code&gt;EAGAIN&lt;/code&gt;, logged as &lt;code&gt;Resource temporarily unavailable&lt;/code&gt;, and Nginx then returns 502. That points to FPM capacity pressure rather than a stopped service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identify which layer emitted the status
&lt;/h2&gt;

&lt;p&gt;Write the request path as a chain before changing anything:&lt;/p&gt;

&lt;p&gt;browser → CDN or edge → reverse proxy → PHP-FPM → WordPress → database or remote service&lt;/p&gt;

&lt;p&gt;Start with the outermost layer whose logs you can access. Find the exact request and establish two facts: which layer returned the 502 or 504 downstream, and what happened when that layer contacted its upstream.&lt;/p&gt;

&lt;p&gt;If you use Cloudflare, its current &lt;a href="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-502-504/" rel="noopener noreferrer"&gt;502 and 504 troubleshooting documentation&lt;/a&gt; separates errors returned by the origin from errors generated by Cloudflare. It also asks for the failing URL plus a timestamp with timezone when escalating an incident. Other edge providers expose different fields, so use that provider's current documentation.&lt;/p&gt;

&lt;p&gt;For an Nginx origin, request-level timing fields are more useful than the error page. Nginx documents &lt;code&gt;$upstream_connect_time&lt;/code&gt;, &lt;code&gt;$upstream_header_time&lt;/code&gt;, &lt;code&gt;$upstream_response_time&lt;/code&gt; and &lt;code&gt;$upstream_status&lt;/code&gt; in its &lt;a href="https://nginx.org/en/docs/http/ngx_http_upstream_module.html" rel="noopener noreferrer"&gt;upstream module reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Use the fields your host already records. If a self-managed Nginx server does not record them, add incident logging through your normal configuration review and rollback process rather than editing production blindly.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evidence for the same request&lt;/th&gt;
&lt;th&gt;Expected interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Edge returns 504, but the origin proxy has no matching request&lt;/td&gt;
&lt;td&gt;Check the edge-to-origin path or the edge itself before investigating WordPress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx returns 502 after connection refusal, a missing socket or no live upstream&lt;/td&gt;
&lt;td&gt;Treat the upstream as unavailable for that attempt, unless a Unix socket reports &lt;code&gt;Resource temporarily unavailable&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx returns 502 with &lt;code&gt;(11: Resource temporarily unavailable)&lt;/code&gt; while connecting to a PHP-FPM Unix socket&lt;/td&gt;
&lt;td&gt;The FPM listen queue was full; treat this as capacity saturation rather than an unavailable service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx returns 504 with &lt;code&gt;while connecting to upstream&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The connection was not established; investigate the upstream connection path and capacity before application code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx returns 504 with &lt;code&gt;while sending request to upstream&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Nginx connected but stalled while transmitting the request; a PHP worker may still not have accepted it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx returns 504 with &lt;code&gt;while reading response header from upstream&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Nginx connected and waited for a response header; check FPM queueing before assuming WordPress code was already running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completed FPM row has &lt;code&gt;%t&lt;/code&gt; after the proxy's 504 and a short &lt;code&gt;%d&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The request likely waited for a free FPM worker; check pool saturation rather than treating the route itself as slow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completed FPM row starts before the proxy timeout and finishes after it, with &lt;code&gt;%d&lt;/code&gt; spanning the wait&lt;/td&gt;
&lt;td&gt;PHP work outlasted the proxy; investigate what kept that request running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PHP finishes before the outer layer times out or answers&lt;/td&gt;
&lt;td&gt;Inspect the proxy or edge path after PHP before blaming PHP execution time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use the Nginx error-log phrase together with &lt;code&gt;$upstream_connect_time&lt;/code&gt; and &lt;code&gt;$upstream_header_time&lt;/code&gt; when those fields are available. &lt;code&gt;$upstream_connect_time&lt;/code&gt; records time spent establishing the upstream connection. &lt;code&gt;$upstream_header_time&lt;/code&gt; records time spent receiving the response header.&lt;/p&gt;

&lt;p&gt;Treat a missing PHP access-log row carefully. PHP-FPM writes its access row when the request finishes. &lt;code&gt;%t&lt;/code&gt; is based on the time an FPM worker accepts and starts reading the request, while &lt;code&gt;%T&lt;/code&gt; records when the access log is written at request end.&lt;/p&gt;

&lt;p&gt;A row can therefore be absent because PHP-FPM access logging is disabled, retention removed it, the request is still executing, or every worker is busy and the connection is still queued. A worker killed by &lt;code&gt;request_terminate_timeout&lt;/code&gt;, or a similar process limit, may also end without the normal access row being written.&lt;/p&gt;

&lt;p&gt;Before concluding that PHP never received a request, check the PHP-FPM error log for an &lt;code&gt;execution timed out ... terminating&lt;/code&gt; warning. If &lt;code&gt;request_slowlog_timeout&lt;/code&gt; and the slowlog are enabled, check the same time window there as well. Pair that evidence with Nginx's connection, send or read-stage error message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run one controlled failing request
&lt;/h2&gt;

&lt;p&gt;Choose one request that already fails reliably. The goal is to reproduce the incident once under controlled conditions, not to create a new failure.&lt;/p&gt;

&lt;p&gt;Use a read-only request when possible. If the failure happens during an action that changes data, reproduce it in staging or use a safe test path approved for that system.&lt;/p&gt;

&lt;p&gt;Record these fields before pressing the button or sending the request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write the exact local time and timezone.&lt;/li&gt;
&lt;li&gt;Record the HTTP method and path, such as the admin URL or endpoint that fails.&lt;/li&gt;
&lt;li&gt;Record the account state that matters, such as logged-in admin versus logged-out visitor.&lt;/li&gt;
&lt;li&gt;Record the response status and the time the response ends.&lt;/li&gt;
&lt;li&gt;Save any provider request identifier that already exists in the response or dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not restart PHP, purge every cache, disable all plugins or change timeout values before collecting the first timeline. Those changes can remove the state you need to explain the failure.&lt;/p&gt;

&lt;p&gt;If the dashboard times out while public pages still work, trace the exact dashboard request first. A cached public page can succeed without exercising the PHP path that handles the admin request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Correlate request timestamps with a worksheet
&lt;/h2&gt;

&lt;p&gt;Use one timezone across every row. If a tool logs in another timezone, convert it before comparing events. Keep the original value in your incident notes.&lt;/p&gt;

&lt;p&gt;PHP-FPM can provide application-side request evidence without adding logging code to WordPress. Its &lt;a href="https://www.php.net/manual/en/install.fpm.configuration.php" rel="noopener noreferrer"&gt;configuration manual&lt;/a&gt; documents &lt;code&gt;access.log&lt;/code&gt; and &lt;code&gt;access.format&lt;/code&gt;. The format can record worker acceptance time, log-write time, duration, method, URI and response status. &lt;code&gt;access.log&lt;/code&gt; is not set by default, so confirm that your host collects equivalent request data before relying on it.&lt;/p&gt;

&lt;p&gt;Remember that the access line is written at request end. Also allow for queueing before &lt;code&gt;%t&lt;/code&gt;: Nginx can establish a connection before an FPM worker accepts it.&lt;/p&gt;

&lt;p&gt;Copy this worksheet for the failing request:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Request evidence&lt;/th&gt;
&lt;th&gt;Status or timing&lt;/th&gt;
&lt;th&gt;What this row proves&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Client&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;time + timezone&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;method&amp;gt; &amp;lt;path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;status&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;end time&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The exact failure the user received&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edge, if present&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;edge request ID or method/path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;edge status&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;origin status if available&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Whether the edge passed through or emitted the error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nginx or other origin proxy&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;method/path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;final status&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;connect/header/response timings&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;error-log action&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Whether connection, request transmission or response reading stalled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PHP-FPM access log, for completed requests&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;%t worker acceptance time&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;method/path&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;%T log-write time&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;%d duration&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;status&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;When a worker picked up and completed the request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PHP-FPM error or slow log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;matching route or worker&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;termination warning or slow backtrace&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whether a worker was executing slow work even when the normal access row is absent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FPM or host capacity view&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;same and following window&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;TCP queue, Unix-socket queue, active/total processes, worker state&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;capacity state&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whether the connection waited for an available worker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WordPress or PHP error log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;matching route or process&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;error, warning or matching event&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whether application code recorded a failure near the request&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not require &lt;code&gt;%t&lt;/code&gt; to fall inside the proxy's original request window. Under saturation, Nginx can connect while every FPM worker is busy. The listen backlog can hold connections until a worker accepts them.&lt;/p&gt;

&lt;p&gt;From PHP 8.2 onward, PHP-FPM's default &lt;code&gt;listen.backlog&lt;/code&gt; is &lt;code&gt;-1&lt;/code&gt; on Linux. Current PHP source uses that value to request the platform maximum. On Linux, the kernel caps the backlog at &lt;code&gt;/proc/sys/net/core/somaxconn&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A pool can also set &lt;code&gt;listen.backlog&lt;/code&gt; explicitly. Read the running configuration rather than assuming a fixed queue size.&lt;/p&gt;

&lt;p&gt;The FPM status page needs another caveat. Its &lt;code&gt;listen queue&lt;/code&gt;, &lt;code&gt;max listen queue&lt;/code&gt; and &lt;code&gt;listen queue len&lt;/code&gt; values are populated from the listening socket only for TCP listeners in current PHP-FPM source. For a Unix-socket listener, those queue fields remain zero even when connections are waiting.&lt;/p&gt;

&lt;p&gt;On Linux with a Unix-socket pool, inspect the listening socket directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -xlp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the matching &lt;code&gt;LISTEN&lt;/code&gt; row, &lt;code&gt;Recv-Q&lt;/code&gt; is the number of connections waiting to be accepted and &lt;code&gt;Send-Q&lt;/code&gt; is the backlog limit. Use that evidence with the pool state rather than using the FPM status page's Unix-socket queue value.&lt;/p&gt;

&lt;p&gt;For a TCP FPM listener, the status page queue fields can provide queue evidence. For either listener type, compare &lt;code&gt;active processes&lt;/code&gt;, &lt;code&gt;total processes&lt;/code&gt; and the configured &lt;code&gt;pm.max_children&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Dynamic pools log &lt;code&gt;server reached pm.max_children setting&lt;/code&gt; when that limit is reached. Ondemand pools use &lt;code&gt;server reached max_children setting&lt;/code&gt; instead. If your log search accepts regular expressions, search for &lt;code&gt;reached.*max_children&lt;/code&gt; to catch both forms.&lt;/p&gt;

&lt;p&gt;Static pools emit neither warning and do not increment the status page's &lt;code&gt;max children reached&lt;/code&gt; counter. For a static pool, compare &lt;code&gt;active processes&lt;/code&gt; with &lt;code&gt;total processes&lt;/code&gt; and &lt;code&gt;pm.max_children&lt;/code&gt;, then combine that with Nginx or socket-queue evidence.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;%t&lt;/code&gt; appears after the Nginx 504 and &lt;code&gt;%d&lt;/code&gt; is short, the missing time happened before the worker accepted the request. For a TCP pool, check the FPM status queue fields. For a Linux Unix-socket pool, use &lt;code&gt;ss -xlp&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;A slow-or-queued upstream scenario can look like this: Nginx connects near &lt;code&gt;T0&lt;/code&gt;, finishes sending the request, then logs &lt;code&gt;while reading response header from upstream&lt;/code&gt; and returns 504 at &lt;code&gt;T1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If an FPM worker was free, the completed access row may later show &lt;code&gt;%t&lt;/code&gt; near &lt;code&gt;T0&lt;/code&gt;. If every worker was occupied, &lt;code&gt;%t&lt;/code&gt; can be much later and can even fall after &lt;code&gt;T1&lt;/code&gt;. A late &lt;code&gt;%t&lt;/code&gt; combined with a short &lt;code&gt;%d&lt;/code&gt; points to listen-backlog queueing rather than slow application execution.&lt;/p&gt;

&lt;p&gt;If the request is still executing at &lt;code&gt;T1&lt;/code&gt;, the FPM access row does not exist yet at that point. Check the slowlog and FPM capacity evidence before deciding which delay occurred.&lt;/p&gt;

&lt;p&gt;A send-timeout scenario can look like this: Nginx connects, then logs &lt;code&gt;while sending request to upstream&lt;/code&gt; and returns 504. Expected interpretation: the connection existed, but Nginx could not finish passing the request upstream within the effective send timeout.&lt;/p&gt;

&lt;p&gt;This case can matter for a large POST or upload when the receiving side is not consuming data. It does not prove an FPM worker started executing WordPress.&lt;/p&gt;

&lt;p&gt;An unavailable-upstream scenario can look like this: Nginx returns 502 after a refused connection, missing socket or no-live-upstream condition. Another unreachable case can return 504: Nginx logs &lt;code&gt;while connecting to upstream&lt;/code&gt; because the connection attempt itself timed out.&lt;/p&gt;

&lt;p&gt;On Linux with a PHP-FPM Unix socket, check for &lt;code&gt;(11: Resource temporarily unavailable)&lt;/code&gt; before calling a 502 an unavailable service. Nginx's source documents that Linux can return &lt;code&gt;EAGAIN&lt;/code&gt; when the Unix-socket listen queue is full.&lt;/p&gt;

&lt;p&gt;When several identical requests happen close together, do one controlled reproduction at a known time rather than matching on the path alone. If your stack already supplies a request ID, use it across every layer that preserves it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check upstream waits and saturation separately
&lt;/h2&gt;

&lt;p&gt;A slow upstream and an unavailable upstream call for different fixes.&lt;/p&gt;

&lt;p&gt;For a refused connection, missing socket, no-live-upstream error, or a 504 logged &lt;code&gt;while connecting to upstream&lt;/code&gt;, check PHP-FPM service health, socket or network reachability, recent deploy changes and host events. Capacity can also block connection establishment, so compare the event with the host's PHP queue and worker evidence.&lt;/p&gt;

&lt;p&gt;For a Unix-socket 502 with &lt;code&gt;Resource temporarily unavailable&lt;/code&gt;, start with FPM capacity. The Linux-specific Nginx path associates that &lt;code&gt;EAGAIN&lt;/code&gt; result with a full Unix-socket listen queue.&lt;/p&gt;

&lt;p&gt;For a timeout &lt;code&gt;while sending request to upstream&lt;/code&gt;, investigate why Nginx could not continue writing the FastCGI request. Check FPM saturation before assuming PHP application code caused the stall.&lt;/p&gt;

&lt;p&gt;For a timeout &lt;code&gt;while reading response header from upstream&lt;/code&gt;, a connection existed, but a worker may still have been waiting to accept it. For TCP listeners, check the FPM status queue fields. For Linux Unix-socket listeners, use &lt;code&gt;ss -xlp&lt;/code&gt; because the FPM status queue fields do not report that queue.&lt;/p&gt;

&lt;p&gt;Also compare &lt;code&gt;active processes&lt;/code&gt; and &lt;code&gt;total processes&lt;/code&gt; with &lt;code&gt;pm.max_children&lt;/code&gt;. For dynamic and ondemand pools, check the matching &lt;code&gt;max_children&lt;/code&gt; warning or counter. For static pools, rely on the process counts plus proxy or socket-queue evidence because the warning and counter are not produced.&lt;/p&gt;

&lt;p&gt;Once &lt;code&gt;%t&lt;/code&gt; shows that a worker accepted the request, use &lt;code&gt;%d&lt;/code&gt;, &lt;code&gt;%T&lt;/code&gt;, application logs and traces to separate slow execution from earlier queueing. If &lt;code&gt;%t&lt;/code&gt; precedes the proxy 504 and &lt;code&gt;%T&lt;/code&gt; follows it, compare &lt;code&gt;%d&lt;/code&gt; with the effective proxy or edge read wait.&lt;/p&gt;

&lt;p&gt;PHP can keep executing after the downstream connection disappears until it detects the disconnect during output, unless its connection-handling settings or code change that behavior. WordPress commonly produces buffered responses, so an FPM access row can show a normal application status after Nginx has already returned 504.&lt;/p&gt;

&lt;p&gt;That later normal PHP status does not clear PHP execution. If &lt;code&gt;%d&lt;/code&gt; shows that PHP ran beyond the outer layer's effective wait, investigate the slow request. Inspect proxy or edge handling first when PHP finished before that outer layer timed out or answered.&lt;/p&gt;

&lt;p&gt;PHP-FPM's &lt;code&gt;pm.max_children&lt;/code&gt; sets the limit on simultaneous requests the pool can serve. If your host exposes worker or queue metrics, compare them with the failure window and the period immediately after it.&lt;/p&gt;

&lt;p&gt;Do not raise worker counts or proxy waits from one 504 alone. A larger wait may make the same slow request occupy capacity for longer, and a larger worker pool must fit the server's memory and workload.&lt;/p&gt;

&lt;p&gt;If application traces point to a remote call made through the WordPress HTTP API, WordPress builds the request's default timeout from five seconds through the &lt;a href="https://developer.wordpress.org/reference/hooks/http_request_timeout/" rel="noopener noreferrer"&gt;&lt;code&gt;http_request_timeout&lt;/code&gt; filter&lt;/a&gt;. A caller can pass its own &lt;code&gt;timeout&lt;/code&gt;, but that still may not be the effective value.&lt;/p&gt;

&lt;p&gt;Code attached to &lt;code&gt;http_request_timeout&lt;/code&gt; can change the default used when the caller does not supply one. After WordPress parses the request arguments, the &lt;code&gt;http_request_args&lt;/code&gt; filter can rewrite them, including an explicit &lt;code&gt;timeout&lt;/code&gt;. To find the effective value, check the call's arguments and callbacks attached to both filters.&lt;/p&gt;

&lt;p&gt;Use host and PHP logs for a production incident before enabling WordPress debug tools. WordPress's current debugging guide says those tools are intended for local testing and staging installs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pinpoint a dashboard-only timeout
&lt;/h2&gt;

&lt;p&gt;Start with the request that the browser shows as failed in the dashboard. Record its method, path, start time and response status, then find that same request in the proxy and PHP records.&lt;/p&gt;

&lt;p&gt;Next, compare it with another dynamic request from the same period that your host confirms reaches PHP. Public page success by itself is weak evidence because a cache may answer that request before PHP runs.&lt;/p&gt;

&lt;p&gt;If an admin request has a long &lt;code&gt;%d&lt;/code&gt; after a worker accepts it, inspect the code path tied to that route. If &lt;code&gt;%t&lt;/code&gt; appears late while &lt;code&gt;%d&lt;/code&gt; stays short, check pool saturation instead. If many dynamic routes queue or time out together, check PHP capacity and upstream health first.&lt;/p&gt;

&lt;p&gt;If Nginx logs &lt;code&gt;while connecting to upstream&lt;/code&gt;, application profiling will not explain that event because the FastCGI connection was never established. A &lt;code&gt;while sending request to upstream&lt;/code&gt; or &lt;code&gt;while reading response header from upstream&lt;/code&gt; message proves a connection existed, but you still need FPM evidence to establish when a worker accepted the request.&lt;/p&gt;

&lt;p&gt;This approach also handles a production-only WordPress 504 error. Keep the failing production timeline, then reproduce the same safe route in staging only after you know which layer to inspect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate recovery with the same request
&lt;/h2&gt;

&lt;p&gt;Apply one fix that matches the evidence. Examples include restoring an unavailable PHP upstream, correcting a broken proxy-to-FPM path, removing slow work from the request, or resolving a capacity problem.&lt;/p&gt;

&lt;p&gt;Then run the same single safe request again under comparable application conditions. Record a second timeline in the same worksheet.&lt;/p&gt;

&lt;p&gt;The expected result is that the outer layer returns the application's intended status and the proxy reaches the expected upstream. For PHP requests, compare the new connection timing, FPM worker acceptance time and execution duration with the failing timeline.&lt;/p&gt;

&lt;p&gt;For a saturation incident, do not deliberately recreate incident-level traffic against the live site. Run the single safe production request, then watch the same worker, queue and proxy evidence during the next natural traffic window of similar size.&lt;/p&gt;

&lt;p&gt;If deliberate load reproduction is needed, run it in staging or during an approved, monitored maintenance window where the production risk has been accepted. Do not generate outage-level load against normal live traffic.&lt;/p&gt;

&lt;p&gt;One successful refresh does not settle an intermittent incident. Keep watching the same route, status codes and capacity evidence during normal traffic that resembles the earlier failure window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Take the next diagnostic step
&lt;/h2&gt;

&lt;p&gt;If the worksheet points to a full PHP pool or long request queue, continue with &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-php-workers" rel="noopener noreferrer"&gt;WordPress PHP workers: size them, spot saturation and use fewer&lt;/a&gt; instead of changing a timeout. If the failing request is checkout, use the guide to &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-checkout-slow" rel="noopener noreferrer"&gt;diagnosing a slow WooCommerce checkout request&lt;/a&gt; after you have isolated the application layer.&lt;/p&gt;

&lt;p&gt;If storage pressure is stopping logs or application writes, move to finding what is filling a WordPress site's disk. For ongoing incident ownership, &lt;a href="https://hamzaahmadaslam.com/services/wordpress-maintenance" rel="noopener noreferrer"&gt;WordPress maintenance and security&lt;/a&gt; covers the operational work around keeping the site healthy.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>monitoring</category>
      <category>troubleshooting</category>
      <category>serveroptimization</category>
    </item>
    <item>
      <title>How to fix a slow WordPress admin dashboard without guesswork</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Wed, 18 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/how-to-fix-a-slow-wordpress-admin-dashboard-without-guesswork-bbo</link>
      <guid>https://dev.to/hamzaahmadaslam/how-to-fix-a-slow-wordpress-admin-dashboard-without-guesswork-bbo</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/fix-slow-wordpress-admin" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt; To fix slow WordPress admin screens safely, time one repeatable request, profile the work inside that request, then change one cause at a time. Query Monitor, browser Network data, WP-CLI, and the database can show whether the delay comes from SQL, AJAX, scheduled jobs, remote HTTP calls, or memory pressure.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix slow WordPress admin issues with a repeatable baseline
&lt;/h2&gt;

&lt;p&gt;Start with one admin screen that is consistently slow. Record its exact URL, the logged-in user role, and the action you take before timing it. A WooCommerce orders screen, an editor load, and a settings save can execute very different code.&lt;/p&gt;

&lt;p&gt;Open the browser Network panel, reload the screen, and record the duration of the main document request. The &lt;a href="https://developer.chrome.com/docs/devtools/network/" rel="noopener noreferrer"&gt;Chrome DevTools Network reference&lt;/a&gt; explains how to inspect request timing. Treat this as an end-to-end baseline because it includes more than PHP execution. Then repeat the same process on an admin screen that feels fast.&lt;/p&gt;

&lt;p&gt;Keep the comparison inside wp-admin and under the same account. A fast public page does not prove the admin path is healthy. A page cache can satisfy public requests without running the PHP and SQL used by an authenticated admin request.&lt;/p&gt;

&lt;p&gt;Record the baseline before installing profiling tools. Use a small table in your notes with the URL, role, action, request duration, and any visible error. You will use that same request after every change.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use Query Monitor to find the blocking work
&lt;/h2&gt;

&lt;p&gt;Install &lt;a href="https://github.com/johnbillion/query-monitor" rel="noopener noreferrer"&gt;Query Monitor from its official project&lt;/a&gt;, reproduce the slow request, then read its panels in a fixed order. Query Monitor records database query time, responsible components and calling functions, PHP errors, and WordPress HTTP API requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Read the panels in this order
&lt;/h3&gt;

&lt;p&gt;Start with the Overview. Compare total page generation time, database query time, query count, and memory use with the fast admin screen. Do not invent a universal threshold. The useful signal is the difference between repeatable requests on the same site.&lt;/p&gt;

&lt;p&gt;Next, inspect database queries grouped by component. This shows whether WordPress core, a plugin, or the active theme owns most of the query work. Then inspect the slow and duplicate query views or filters for individual statements that deserve attention.&lt;/p&gt;

&lt;p&gt;After SQL, open HTTP API Requests. Look for remote requests whose elapsed time is a meaningful part of the page request. Finish with PHP Errors. Warnings, notices, and deprecated calls can reveal broken code paths even when they are not the main timing cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trace a slow query to its caller
&lt;/h3&gt;

&lt;p&gt;Query Monitor records the calling function and responsible component for each database query. Its database collector also records a stack trace when the Query Monitor database drop-in is active.&lt;/p&gt;

&lt;p&gt;Open the slow query, identify its component, then inspect the caller or stack trace. Follow the first useful frame into plugin or theme code. That connects the SQL statement to the callback or method that issued it, rather than blaming a table because it happens to be large.&lt;/p&gt;

&lt;p&gt;If several slow statements belong to one component, filter the query list by that component. Reproduce the same screen again after disabling or correcting only that code path on a safe staging copy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Treat an expensive query at its source
&lt;/h3&gt;

&lt;p&gt;A pattern like this can become expensive as &lt;code&gt;wp_postmeta&lt;/code&gt; grows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;post_id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_postmeta&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;meta_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'_example_code'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;meta_value&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="s1"&gt;'%sample-code%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The substring condition on &lt;code&gt;meta_value&lt;/code&gt; is the warning sign. WordPress core stores &lt;code&gt;meta_value&lt;/code&gt; as &lt;code&gt;LONGTEXT&lt;/code&gt; and does not index that column by default, so substring matching can examine many metadata rows after the &lt;code&gt;meta_key&lt;/code&gt; filter.&lt;/p&gt;

&lt;p&gt;Trace the caller before changing the database. The right fix may be changing the data model, narrowing the query, avoiding substring matching, or caching a stable result. Do not add an index blindly to a production table.&lt;/p&gt;

&lt;p&gt;If repeated object lookups remain costly after the query and data model are sound, review the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-redis-object-cache" rel="noopener noreferrer"&gt;WordPress Redis object cache guide&lt;/a&gt;. Persistent object caching can reduce repeated database reads, but it does not repair a poor query pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to measure autoloaded options on WordPress 6.6 and later
&lt;/h2&gt;

&lt;p&gt;Since WordPress 6.6, the database can use several autoload states. Core's &lt;code&gt;wp_autoload_values_to_autoload()&lt;/code&gt; currently treats &lt;code&gt;yes&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;auto-on&lt;/code&gt;, and &lt;code&gt;auto&lt;/code&gt; as values that should load. The &lt;a href="https://make.wordpress.org/core/2024/06/18/options-api-disabling-autoload-for-large-options/" rel="noopener noreferrer"&gt;WordPress 6.6 Options API dev note&lt;/a&gt; documents the change.&lt;/p&gt;

&lt;p&gt;For an exact current total, query those values through WP-CLI. &lt;code&gt;LENGTH()&lt;/code&gt; returns bytes, so the first command gives the stored byte total for autoloaded option values. The second sorts individual options from largest to smallest.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;TABLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(wp db prefix)options"&lt;/span&gt;

wp db query &lt;span class="s2"&gt;"SELECT COALESCE(SUM(LENGTH(option_value)),0) AS autoload_bytes FROM ${TABLE} WHERE autoload IN ('yes','on','auto-on','auto');"&lt;/span&gt; --skip-column-names

wp db query &lt;span class="s2"&gt;"SELECT option_name, LENGTH(option_value) AS size_bytes, autoload FROM ${TABLE} WHERE autoload IN ('yes','on','auto-on','auto') ORDER BY size_bytes DESC;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can run the same check directly in MySQL. Replace &lt;code&gt;wp_options&lt;/code&gt; if the site uses a different table prefix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="nb"&gt;COALESCE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;autoload_bytes&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_options&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;autoload&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto-on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;option_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;size_bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;autoload&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_options&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;autoload&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto-on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;size_bytes&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The total tells you the size of the autoload set. The sorted rows tell you which options deserve ownership checks. Do not delete an unfamiliar option because it is large. Find the plugin or theme that owns it, confirm whether it still needs the data, and change autoload behavior through supported code where possible.&lt;/p&gt;

&lt;p&gt;For the underlying rules and cleanup decisions, use the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-autoload-options" rel="noopener noreferrer"&gt;guide to WordPress autoloaded options&lt;/a&gt;. You can also paste the WP-CLI results into the &lt;a href="https://hamzaahmadaslam.com/tools/autoload-options" rel="noopener noreferrer"&gt;free autoloaded options analyser&lt;/a&gt; to organize the review.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to identify admin-ajax and Heartbeat requests
&lt;/h2&gt;

&lt;p&gt;A slow wp-admin screen may be fine on initial load but become sluggish while it stays open. In the browser Network panel, filter for &lt;code&gt;admin-ajax.php&lt;/code&gt;, select a request, and inspect its request payload. The &lt;code&gt;action&lt;/code&gt; field identifies the AJAX action that WordPress is dispatching.&lt;/p&gt;

&lt;p&gt;Do not assume every &lt;code&gt;admin-ajax.php&lt;/code&gt; request is Heartbeat. A Heartbeat request uses the Heartbeat AJAX path, while plugins can register their own actions on the same endpoint. Record the action name, duration, initiator, and response before changing anything.&lt;/p&gt;

&lt;p&gt;If Heartbeat itself is creating avoidable load, adjust its interval through the documented &lt;a href="https://developer.wordpress.org/reference/hooks/heartbeat_settings/" rel="noopener noreferrer"&gt;&lt;code&gt;heartbeat_settings&lt;/code&gt; filter&lt;/a&gt;. WordPress introduced that filter in version 3.6.0.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;add_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'heartbeat_settings'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$settings&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$settings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'interval'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$settings&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example changes the interval rather than disabling Heartbeat globally. Core uses Heartbeat for post-lock refreshes and includes a Heartbeat autosave path. Test editing, autosave, and concurrent editing behavior after the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to inspect Action Scheduler and WP-Cron
&lt;/h2&gt;

&lt;p&gt;On WooCommerce, open WooCommerce &amp;gt; Status &amp;gt; Scheduled Actions. Inspect Pending actions whose scheduled date is already past, then inspect Failed actions and their logs. A queue that is not moving can make admin work compete with background processing or can indicate that cron execution is not reliable.&lt;/p&gt;

&lt;p&gt;Current Action Scheduler WP-CLI provides the &lt;code&gt;action list&lt;/code&gt; command. Past-due actions are pending actions whose scheduled date has passed. To list them, then list failed actions, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp action-scheduler action list \
  --status=pending \
  --date=&lt;span class="s1"&gt;'now'&lt;/span&gt; \
  --date_compare=&lt;span class="s1"&gt;'&amp;lt;='&lt;/span&gt; \
  --fields=id,hook,status,group,scheduled_date

wp action-scheduler action list \
  --status=failed \
  --fields=id,hook,status,group,scheduled_date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a past-due row, inspect the hook and group before running or deleting anything. For a failed row, use the Scheduled Actions screen to read its log and identify the failing callback. Fix the cause before manually pushing a blocked queue.&lt;/p&gt;

&lt;p&gt;WP-Cron normally gets opportunities to run during site requests. If you replace that traffic-driven trigger with the system scheduler, disable WordPress's page-load trigger in &lt;code&gt;wp-config.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'DISABLE_WP_CRON'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then call &lt;code&gt;wp-cron.php&lt;/code&gt; from the server scheduler. Replace the example host with the site's canonical HTTPS host.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* * * * * wget --delete-after https://example.com/wp-cron.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The official &lt;a href="https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/" rel="noopener noreferrer"&gt;WordPress system scheduler guide&lt;/a&gt; documents &lt;code&gt;DISABLE_WP_CRON&lt;/code&gt; and server-level scheduling. Confirm the cron user can execute the request successfully before relying on this setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to spot remote HTTP calls that delay wp-admin
&lt;/h2&gt;

&lt;p&gt;License validation, update checks, feeds, and remote service calls can run during an admin request. If they use the WordPress HTTP API, Query Monitor lists the destination, response code, component, timeout, call stack, and elapsed time.&lt;/p&gt;

&lt;p&gt;Start with the calls that consume a visible share of the slow request. Trace each call to its component and caller, then determine why it runs on that screen. A remote request needed only for a settings page should not be moved blindly, but repeated synchronous checks often belong behind caching or a scheduled refresh.&lt;/p&gt;

&lt;p&gt;Check failures as well as slow successes. DNS problems, TLS errors, blocked outbound traffic, or an unreachable vendor endpoint can hold a PHP worker while the request waits for its configured timeout.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to separate memory pressure from PHP worker exhaustion
&lt;/h2&gt;

&lt;p&gt;WordPress uses &lt;code&gt;WP_MAX_MEMORY_LIMIT&lt;/code&gt; when it attempts to raise memory for administration work. Core documents the default as &lt;code&gt;256M&lt;/code&gt;, or the original PHP &lt;code&gt;memory_limit&lt;/code&gt; when that value is higher.&lt;/p&gt;

&lt;p&gt;This is the documented configuration form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'WP_MAX_MEMORY_LIMIT'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'512M'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Place it in &lt;code&gt;wp-config.php&lt;/code&gt; before WordPress loads &lt;code&gt;wp-settings.php&lt;/code&gt;. Treat the value above as a configuration example from the WordPress documentation, not as a target for every site.&lt;/p&gt;

&lt;p&gt;A larger ceiling can prevent an out-of-memory failure, but it does not make slow SQL, remote requests, or background jobs faster. It can also let each PHP process consume more memory.&lt;/p&gt;

&lt;p&gt;PHP workers are a separate constraint. If all available workers are busy with slow admin, AJAX, cron, or checkout requests, later requests wait for a worker. Check host or PHP-FPM metrics for active workers, queueing, and process saturation while reproducing the same slow screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to verify that the fix worked
&lt;/h2&gt;

&lt;p&gt;Change one cause at a time. Then repeat the same URL, user role, browser action, and measurement method you recorded at the start.&lt;/p&gt;

&lt;p&gt;Record the new document request duration and the relevant Query Monitor totals. If you changed AJAX behavior, recheck the same &lt;code&gt;admin-ajax.php&lt;/code&gt; action. If you changed cron handling, confirm the scheduled queue is advancing without creating new failures.&lt;/p&gt;

&lt;p&gt;This discipline is the safest way to fix slow WordPress admin behavior without mistaking a random fast request for an improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;Keep the before-and-after record with the site, then fix the largest confirmed source of delay first. If the cause spans SQL, background queues, object caching, and server capacity, use the &lt;a href="https://hamzaahmadaslam.com/services/wordpress-performance-optimization" rel="noopener noreferrer"&gt;WordPress performance optimization service&lt;/a&gt; for a structured audit and remediation plan.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>wpadmin</category>
      <category>querymonitor</category>
      <category>database</category>
    </item>
    <item>
      <title>Why a WooCommerce variation selector feels slow</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Tue, 17 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/why-a-woocommerce-variation-selector-feels-slow-2o92</link>
      <guid>https://dev.to/hamzaahmadaslam/why-a-woocommerce-variation-selector-feels-slow-2o92</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-variation-dropdown-slow" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;When a WooCommerce variation dropdown is slow, record the attribute selection itself before changing caching, hosting, or the variation count. Check whether the delay happens in browser JavaScript, during a variation request, or while the page updates price, stock, and availability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diagnose why a WooCommerce variation dropdown feels slow
&lt;/h2&gt;

&lt;p&gt;A variable product can store a different price, stock state, image, and other data for each variation. After all required attributes are selected, WooCommerce updates the page with data for the matching variation, as described in the &lt;a href="https://woocommerce.com/document/variable-product/" rel="noopener noreferrer"&gt;WooCommerce variable product documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That means "slow" can describe several different delays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The dropdown does not react promptly after a click.&lt;/li&gt;
&lt;li&gt;The next attribute takes time to update.&lt;/li&gt;
&lt;li&gt;A completed selection waits for a network request.&lt;/li&gt;
&lt;li&gt;The correct variation is found quickly, but its price or stock display updates late.&lt;/li&gt;
&lt;li&gt;A swatch or variation extension adds work before or after WooCommerce handles the selection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Treat those as separate problems. General page speed tells you useful context, but it does not identify which part of the selection interaction is responsible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the selection before changing the store
&lt;/h2&gt;

&lt;p&gt;Use a staging copy when disabling extensions, changing the threshold, or creating synthetic products. Keep the theme, plugins, product template, browser, and test device fixed while comparing configurations.&lt;/p&gt;

&lt;p&gt;Start with the same shopper path each time. For example, load the product, choose the first attribute, choose the final attribute, then wait for price and availability to settle.&lt;/p&gt;

&lt;p&gt;Record the interaction in Chrome DevTools. The &lt;a href="https://developer.chrome.com/docs/devtools/performance/reference" rel="noopener noreferrer"&gt;Performance panel documentation&lt;/a&gt; shows how the Interactions track exposes input delay, processing time, and presentation delay.&lt;/p&gt;

&lt;p&gt;Google describes interaction latency as three parts in its &lt;a href="https://web.dev/articles/optimize-inp" rel="noopener noreferrer"&gt;INP optimization guidance&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interaction latency = input delay + processing duration + presentation delay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Input delay points toward work already occupying the browser's main thread. Processing duration covers event-handler work. Presentation delay covers the time until the changed interface can be painted.&lt;/p&gt;

&lt;p&gt;If the variation selector is the interaction hurting site responsiveness, use the same recording method described in &lt;a href="https://hamzaahmadaslam.com/blog/fix-inp-wordpress" rel="noopener noreferrer"&gt;finding the interaction behind poor WordPress INP&lt;/a&gt; rather than judging the page only by its initial load.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copy this interaction trace
&lt;/h3&gt;

&lt;p&gt;The catalog below is illustrative. Its variation counts and names are test data, not measured store results.&lt;/p&gt;

&lt;p&gt;Synthetic catalog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product: "Synthetic variation trace shirt", illustrative.&lt;/li&gt;
&lt;li&gt;Attributes: Color and Size, illustrative.&lt;/li&gt;
&lt;li&gt;Clone A: 4 colors × 5 sizes = 20 possible combinations, with 1 combination left without a variation = 19 variation records, illustrative.&lt;/li&gt;
&lt;li&gt;Clone B: 4 colors × 8 sizes = 32 possible combinations, with 2 combinations left without variations = 30 variation records, illustrative.&lt;/li&gt;
&lt;li&gt;Clone C: 5 colors × 7 sizes = 35 possible combinations, with 1 combination left without a variation = 34 variation records, illustrative.&lt;/li&gt;
&lt;li&gt;Clone D: 10 colors × 6 sizes = 60 possible combinations, with 1 combination left without a variation = 59 variation records, illustrative.&lt;/li&gt;
&lt;li&gt;Keep the same media, descriptions, template, stock rules, and active extensions across the clones.&lt;/li&gt;
&lt;li&gt;Include an available higher-priced variation, an out-of-stock variation with variation-level stock management and backorders disabled, and Green / Large as one attribute combination for which no variation record exists.&lt;/li&gt;
&lt;li&gt;For the out-of-stock test, enable "Hide out of stock items from the catalog" so you can compare option filtering below the threshold with static dropdown behavior above it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;WooCommerce core chooses whether to preload variation data by comparing the number of child variation records with the configured threshold. It counts &lt;code&gt;$product-&amp;gt;get_children()&lt;/code&gt;, rather than multiplying the number of possible attribute values, in the &lt;a href="https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/wc-template-functions.php" rel="noopener noreferrer"&gt;current variable add-to-cart template function&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fill in this header before each test run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TEST ENVIRONMENT
Device / CPU / RAM: [record]
Operating system: [record version]
Browser: [record version]
WordPress: [record version]
WooCommerce: [record version]
Theme: [record name and version]
Variation or swatch plugins: [record names and versions, or none]
Optimization / script plugins: [record names and versions, or none]
Cache state: [record]
Network profile: [record]
Configured woocommerce_ajax_variation_threshold: [record]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then capture the interaction:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Illustrative case&lt;/th&gt;
&lt;th&gt;Variation records&lt;/th&gt;
&lt;th&gt;First attribute behavior expected with core default&lt;/th&gt;
&lt;th&gt;Final selection request expected&lt;/th&gt;
&lt;th&gt;Document/payload notes&lt;/th&gt;
&lt;th&gt;Input delay&lt;/th&gt;
&lt;th&gt;Processing&lt;/th&gt;
&lt;th&gt;Presentation&lt;/th&gt;
&lt;th&gt;Price/stock correct?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Clone A&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;Dynamic option filtering&lt;/td&gt;
&lt;td&gt;Record whether &lt;code&gt;get_variation&lt;/code&gt; occurs&lt;/td&gt;
&lt;td&gt;Record document bytes and variation data&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clone B&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;Dynamic option filtering&lt;/td&gt;
&lt;td&gt;Record whether &lt;code&gt;get_variation&lt;/code&gt; occurs&lt;/td&gt;
&lt;td&gt;Record document bytes and variation data&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clone C&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;Static attribute options&lt;/td&gt;
&lt;td&gt;Expect variation lookup after all attributes are selected&lt;/td&gt;
&lt;td&gt;Record request and response size&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clone D&lt;/td&gt;
&lt;td&gt;59&lt;/td&gt;
&lt;td&gt;Static attribute options&lt;/td&gt;
&lt;td&gt;Expect variation lookup after all attributes are selected&lt;/td&gt;
&lt;td&gt;Record request and response size&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;td&gt;[record]&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Those expectations assume the core threshold remains at its documented default and an extension has not replaced the selection behavior.&lt;/p&gt;

&lt;p&gt;Do not treat these variation counts as performance targets. They are controlled test cases around WooCommerce's documented behavior switch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect the payload and variation scripting
&lt;/h2&gt;

&lt;p&gt;WooCommerce documents a default threshold of 30 variations. With 30 or fewer, its dropdowns are dynamic. With more than 30, the dropdowns are static and can still show attribute values that do not form a valid combination.&lt;/p&gt;

&lt;p&gt;WooCommerce says this behavior exists because calculating available combinations after each selection can become expensive. The exact product count that feels slow still depends on the product data, browser, theme, device, and extensions.&lt;/p&gt;

&lt;p&gt;The current &lt;a href="https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/client/legacy/js/frontend/add-to-cart-variation.js" rel="noopener noreferrer"&gt;WooCommerce variation JavaScript&lt;/a&gt; also gives you a useful diagnostic distinction. When the form is in its AJAX path, core waits until all attribute fields have values, then sends a POST request to the &lt;code&gt;get_variation&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;Use the Network panel while making the same selection:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clear previous requests.&lt;/li&gt;
&lt;li&gt;Change the first attribute.&lt;/li&gt;
&lt;li&gt;Note whether the second selector updates without a network lookup.&lt;/li&gt;
&lt;li&gt;Complete every required attribute.&lt;/li&gt;
&lt;li&gt;Look for a request whose WooCommerce endpoint is &lt;code&gt;get_variation&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Record when the request starts, how long the browser waits for it, and when the visible price and availability change.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also inspect the product form's &lt;code&gt;data-product_variations&lt;/code&gt; attribute. Compare its contents and the document size across the controlled products.&lt;/p&gt;

&lt;p&gt;That comparison separates two different costs. One configuration can give the browser more variation data to match locally. Another can defer the matching lookup until the shopper completes the selection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare variation configurations without inventing a magic limit
&lt;/h2&gt;

&lt;p&gt;A slow WooCommerce variable product should be tested on both sides of the actual threshold configured on that site.&lt;/p&gt;

&lt;p&gt;Do not conclude that the product becomes "too large" at 30 variations. WooCommerce uses 30 as its default switch for dropdown behavior, not as a documented maximum safe product size.&lt;/p&gt;

&lt;p&gt;Compare products while changing one variable at a time. If Clone A and Clone B respond cleanly but the AJAX cases wait on &lt;code&gt;get_variation&lt;/code&gt;, inspect that request. If the request finishes promptly but the interface remains blocked, inspect browser processing and rendering after the response.&lt;/p&gt;

&lt;p&gt;If the non-AJAX cases become slower as variation data grows, inspect the work performed by the selection handlers. A long processing segment points toward JavaScript work rather than network latency.&lt;/p&gt;

&lt;p&gt;This decision table keeps the diagnosis narrow:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Trace result&lt;/th&gt;
&lt;th&gt;Check next&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Long delay before any selection handler runs&lt;/td&gt;
&lt;td&gt;Main-thread work from other scripts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long processing with no variation request&lt;/td&gt;
&lt;td&gt;Variation matching or extension JavaScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long &lt;code&gt;get_variation&lt;/code&gt; request&lt;/td&gt;
&lt;td&gt;Server-side variation lookup or code attached to that request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fast request followed by late visual update&lt;/td&gt;
&lt;td&gt;JavaScript callbacks, DOM changes, style, layout, or painting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Different behavior only after a plugin is enabled&lt;/td&gt;
&lt;td&gt;That plugin's variation UI, events, script loading, or DOM replacement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance improves but combinations become wrong&lt;/td&gt;
&lt;td&gt;Reject the change and restore correctness before further tuning&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Find JavaScript conflicts before blaming variation count
&lt;/h2&gt;

&lt;p&gt;A variation selector can stop working when another plugin changes the same controls, replaces the dropdown with swatches, delays WooCommerce's scripts, or produces a JavaScript error during the interaction.&lt;/p&gt;

&lt;p&gt;Reproduce the fault with DevTools open. Check the Console and Performance recording at the exact selection that fails. Then test the suspected extension on staging rather than disabling production functionality while customers are using it.&lt;/p&gt;

&lt;p&gt;If several marketing, analytics, personalization, or interface scripts run around the same click, &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-third-party-scripts" rel="noopener noreferrer"&gt;audit the site's third-party scripts&lt;/a&gt; separately. Keep this variation test focused on code that executes during attribute selection.&lt;/p&gt;

&lt;p&gt;A plugin conflict can also produce a correctness problem without a dramatic delay. For example, the interface may display an old price after a new variation has been selected. That is why a faster trace is incomplete until the resulting product state is checked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change the WooCommerce AJAX variation threshold carefully
&lt;/h2&gt;

&lt;p&gt;WooCommerce documents the &lt;code&gt;woocommerce_ajax_variation_threshold&lt;/code&gt; filter for changing the default. Its &lt;a href="https://woocommerce.com/document/change-limit-on-number-of-variations-for-dynamic-variable-product-dropdowns/" rel="noopener noreferrer"&gt;threshold documentation&lt;/a&gt; uses 50 as an example and advises choosing the lowest value that works because higher values can affect product-page performance.&lt;/p&gt;

&lt;p&gt;This illustrative site-specific override follows that documented pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;haa_variation_threshold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$threshold&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;add_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'woocommerce_ajax_variation_threshold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'haa_variation_threshold'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WordPress documents &lt;code&gt;add_filter()&lt;/code&gt; as the function that attaches a callback to a filter hook. In the call above, the callback uses priority &lt;code&gt;10&lt;/code&gt; and accepts the two arguments supplied by the WooCommerce filter.&lt;/p&gt;

&lt;p&gt;Do not copy &lt;code&gt;50&lt;/code&gt; as a performance recommendation. Test the value against your catalog, device mix, theme, and extensions.&lt;/p&gt;

&lt;p&gt;Run the trace before and after the change. A higher threshold may restore earlier filtering of unavailable choices, while also changing how much variation work happens in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify price, stock, and unavailable combinations
&lt;/h2&gt;

&lt;p&gt;Performance work on variation selection must preserve the selected product state.&lt;/p&gt;

&lt;p&gt;WooCommerce can assign variation-specific prices and stock. It also distinguishes an unavailable combination, where no matching variation exists, from a variation that exists but cannot currently be purchased.&lt;/p&gt;

&lt;p&gt;Use this illustrative correctness matrix before and after each change:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Illustrative selection&lt;/th&gt;
&lt;th&gt;Catalog state&lt;/th&gt;
&lt;th&gt;Expected result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Blue / Medium&lt;/td&gt;
&lt;td&gt;Variation exists, in stock, base price&lt;/td&gt;
&lt;td&gt;Matching variation appears, correct price appears, purchase control becomes available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blue / Large&lt;/td&gt;
&lt;td&gt;Variation exists, in stock, higher price&lt;/td&gt;
&lt;td&gt;Higher variation price appears and the selected variation remains purchasable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red / Medium&lt;/td&gt;
&lt;td&gt;Variation exists, out of stock, variation-level stock managed, backorders disabled&lt;/td&gt;
&lt;td&gt;With "Hide out of stock items" enabled, option visibility depends on threshold mode. At or below the threshold, loaded variation data can filter unavailable choices. Above the threshold, dropdowns are static, so the choice can still appear; selecting it must not make the variation purchasable or enable add to cart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Green / Large&lt;/td&gt;
&lt;td&gt;No variation record exists&lt;/td&gt;
&lt;td&gt;Interface must reject the combination rather than reuse data from another variation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The threshold matters to the stock test. In the current core script, &lt;code&gt;onUpdateAttributes&lt;/code&gt; returns without running its option filtering when the form uses AJAX variation lookup. That is the mode core enters when variation data was not preloaded above the threshold.&lt;/p&gt;

&lt;p&gt;The inventory settings still matter as well. WooCommerce documents hiding out-of-stock variations when "Hide out of stock items from the catalog" is enabled, stock is managed at variation level, the variation is out of stock, and backorders are disabled. Above the variation threshold, however, the static selectors can still expose the attribute choice before the completed selection is checked.&lt;/p&gt;

&lt;p&gt;Also test reset behavior. Clear the attributes and confirm that stale price, stock, variation ID, or availability state does not remain attached to the next selection.&lt;/p&gt;

&lt;p&gt;Repeat the matrix with any swatch, gallery, dynamic pricing, stock, or product-options extension enabled. Those plugins may react to the same variation change even when core matching is fast.&lt;/p&gt;

&lt;p&gt;A change only passes when both conditions hold: the interaction trace improves for the intended case, and every expected product state remains correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;Once the trace identifies variation selection as the bottleneck, keep the fix tied to that interaction. Use the &lt;a href="https://hamzaahmadaslam.com/blog/woocommerce-speed-core-web-vitals" rel="noopener noreferrer"&gt;WooCommerce Core Web Vitals performance guide&lt;/a&gt; only when the evidence points to wider product-page work rather than the selector itself.&lt;/p&gt;

&lt;p&gt;For a store where theme code, variation extensions, and catalog structure all affect the trace, &lt;a href="https://hamzaahmadaslam.com/services/woocommerce-speed-optimization" rel="noopener noreferrer"&gt;WooCommerce speed optimization&lt;/a&gt; can take the recorded interaction, payload comparison, and correctness matrix as the starting evidence instead of beginning with generic speed changes.&lt;/p&gt;

</description>
      <category>woocommerce</category>
      <category>performance</category>
      <category>javascript</category>
      <category>corewebvitals</category>
    </item>
    <item>
      <title>WordPress autoloaded options: measure and review wp_options</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sun, 15 Nov 2026 14:00:31 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/wordpress-autoloaded-options-measure-and-review-wpoptions-1648</link>
      <guid>https://dev.to/hamzaahmadaslam/wordpress-autoloaded-options-measure-and-review-wpoptions-1648</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-autoload-options" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt; WordPress autoloaded options are rows in &lt;code&gt;wp_options&lt;/code&gt; that WordPress loads into the &lt;code&gt;alloptions&lt;/code&gt; array during a normal request. Measure the core autoload set, identify the largest rows and their owners, then disable autoload only for options that are not needed broadly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What WordPress autoloaded options do
&lt;/h2&gt;

&lt;p&gt;WordPress does not fetch every option with a separate query. The core &lt;a href="https://developer.wordpress.org/reference/functions/wp_load_alloptions/" rel="noopener noreferrer"&gt;&lt;code&gt;wp_load_alloptions()&lt;/code&gt; function&lt;/a&gt; first checks the &lt;code&gt;alloptions&lt;/code&gt; cache entry in the &lt;code&gt;options&lt;/code&gt; cache group. If that entry is unavailable, it selects the options whose &lt;code&gt;autoload&lt;/code&gt; values are considered loadable, builds one array, and caches that array as &lt;code&gt;alloptions&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Without a persistent object cache, the default WordPress object cache lasts only for the current request. A new PHP request therefore has to rebuild the cache when &lt;code&gt;wp_load_alloptions()&lt;/code&gt; runs. With a persistent object cache, the &lt;code&gt;alloptions&lt;/code&gt; array can persist between requests as one cache key.&lt;/p&gt;

&lt;p&gt;That distinction matters when reading a database profile. A persistent cache can remove repeated database reads for &lt;code&gt;alloptions&lt;/code&gt;, but it does not make an oversized array free. WordPress still has to retrieve and work with the cached value when it is needed.&lt;/p&gt;

&lt;p&gt;For a wp_options autoload audit, measure what core treats as autoloaded. Do not assume that only rows containing &lt;code&gt;yes&lt;/code&gt; count on current WordPress.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in WordPress 6.6
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://make.wordpress.org/core/2024/06/18/options-api-disabling-autoload-for-large-options/" rel="noopener noreferrer"&gt;WordPress 6.6 Options API dev note&lt;/a&gt; changed both the stored values and the default decision process. Existing &lt;code&gt;yes&lt;/code&gt; and &lt;code&gt;no&lt;/code&gt; rows were not migrated, so a current database can contain legacy and newer values together.&lt;/p&gt;

&lt;p&gt;The possible values you are likely to see are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;yes&lt;/code&gt;: legacy value that is still treated as autoloaded.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;no&lt;/code&gt;: legacy value that is not autoloaded.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;on&lt;/code&gt;: an explicit autoload choice of &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;off&lt;/code&gt;: an explicit autoload choice of &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auto&lt;/code&gt;: no explicit choice, with core deciding the default behavior.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auto-on&lt;/code&gt;: a dynamically determined value that should autoload.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auto-off&lt;/code&gt;: a dynamically determined value that should not autoload.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since WordPress 6.6, &lt;code&gt;wp_autoload_values_to_autoload()&lt;/code&gt; returns &lt;code&gt;yes&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;auto-on&lt;/code&gt;, and &lt;code&gt;auto&lt;/code&gt; by default. The filter with the same name can remove values from that default set, but it cannot add arbitrary new values.&lt;/p&gt;

&lt;p&gt;WordPress 6.6 also changed the default handling of large option values. When WordPress determines autoload automatically, a serialized option value greater than the &lt;code&gt;wp_max_autoloaded_option_size&lt;/code&gt; threshold is not autoloaded. The default threshold is 150,000 bytes, and the filter can change it per option. For a new option saved without an explicit choice, a value above that threshold is therefore not autoloaded by default.&lt;/p&gt;

&lt;p&gt;This rule does not mean every option larger than 150,000 bytes is forced off. Code that explicitly requests autoloading can still set an option to autoload. The size heuristic applies when WordPress is choosing the default.&lt;/p&gt;

&lt;p&gt;WordPress 6.6 also added the Site Health autoloaded options check. Its default threshold is 800,000 bytes through &lt;code&gt;site_status_autoloaded_options_size_limit&lt;/code&gt;. Core reports the test as good below that limit and critical at the limit or above.&lt;/p&gt;

&lt;p&gt;Treat that value as a Site Health threshold, not as a promise that every site below it is fast. The useful question is which data is loaded on every request and whether that data needs to be there.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to measure WordPress autoloaded options with SQL
&lt;/h2&gt;

&lt;p&gt;For WordPress 6.6 and later, use the same default values that core treats as autoloaded. Replace &lt;code&gt;wp_options&lt;/code&gt; if the site uses a different table prefix.&lt;/p&gt;

&lt;p&gt;Start with the total:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_kb&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_options&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;autoload&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto-on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;LENGTH()&lt;/code&gt; returns bytes for the stored option value. &lt;code&gt;total_bytes&lt;/code&gt; gives you the raw total, while &lt;code&gt;total_kb&lt;/code&gt; makes the result easier to scan.&lt;/p&gt;

&lt;p&gt;Then list the 20 largest rows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;option_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;autoload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;size_bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;LENGTH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;option_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;size_kb&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_options&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;autoload&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto-on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'auto'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;size_bytes&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query shows which rows dominate the autoload size. The &lt;code&gt;autoload&lt;/code&gt; column also tells you whether each row is legacy, explicitly enabled, or automatically enabled.&lt;/p&gt;

&lt;p&gt;These queries mirror the default WordPress 6.6+ autoload values. If the site uses the &lt;code&gt;wp_autoload_values_to_autoload&lt;/code&gt; filter to remove a value, core can load a smaller set than this SQL query reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to measure with WP-CLI
&lt;/h2&gt;

&lt;p&gt;WP-CLI provides a quick inventory through &lt;a href="https://developer.wordpress.org/cli/commands/option/list/" rel="noopener noreferrer"&gt;&lt;code&gt;wp option list&lt;/code&gt;&lt;/a&gt;. To list option names and stored sizes, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp option list --autoload=on --fields=option_name,size_bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output, with illustrative values only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------------------+------------+
| option_name              | size_bytes |
+--------------------------+------------+
| siteurl                  | 28         |
| active_plugins           | 1462       |
| acme_plugin_settings     | 18432      |
| example_builder_cache    | 73120      |
| rewrite_rules            | 41288      |
+--------------------------+------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read &lt;code&gt;size_bytes&lt;/code&gt; as the stored size of each option value. A large row is a lead for investigation, not proof that the row is wrong. A settings array used on most requests may be a valid autoload candidate, while a similarly sized admin-only cache may not be.&lt;/p&gt;

&lt;p&gt;For the WP-CLI total, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp option list --autoload=on --format=total_bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is an important difference between current WP-CLI output and the WordPress 6.6+ SQL above. Current WP-CLI maps &lt;code&gt;--autoload=on&lt;/code&gt; to rows with &lt;code&gt;autoload='on'&lt;/code&gt; or &lt;code&gt;autoload='yes'&lt;/code&gt;. It does not include &lt;code&gt;auto&lt;/code&gt; or &lt;code&gt;auto-on&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The command also excludes transient rows by default. Because of those two behaviors, the WP-CLI total can be lower than the core autoload set measured by the SQL query or Site Health.&lt;/p&gt;

&lt;p&gt;That makes the SQL query the better reference when you need a WordPress 6.6+ total. The WP-CLI command is still useful for a fast inventory and for sharing results.&lt;/p&gt;

&lt;p&gt;You can paste that exact list output into the &lt;a href="https://hamzaahmadaslam.com/tools/autoload-options" rel="noopener noreferrer"&gt;free autoloaded options analyser&lt;/a&gt;. It calculates the total, surfaces the largest rows, and groups option-name prefixes so you can see which families of settings deserve attention first.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to find which plugin owns a large option
&lt;/h2&gt;

&lt;p&gt;Do not change a row just because its name is unfamiliar. First identify the code that creates and reads it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start with the option name
&lt;/h3&gt;

&lt;p&gt;Prefixes often point to a plugin, theme, or internal module. An option named &lt;code&gt;acme_plugin_settings&lt;/code&gt; is easier to trace than a generic name such as &lt;code&gt;settings&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Treat the prefix as a clue, not proof. Plugins can rename products, share libraries, inherit old prefixes, or keep options after deactivation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Search the code that reads and writes it
&lt;/h3&gt;

&lt;p&gt;Search active plugins, must-use plugins, themes, and custom code for the exact option name. Look for calls such as &lt;code&gt;get_option()&lt;/code&gt;, &lt;code&gt;add_option()&lt;/code&gt;, &lt;code&gt;update_option()&lt;/code&gt;, and &lt;code&gt;register_setting()&lt;/code&gt; around that name.&lt;/p&gt;

&lt;p&gt;If the full name is generated dynamically, search for a stable prefix. Also inspect inactive plugin code when the option may be left from an older installation.&lt;/p&gt;

&lt;p&gt;The key question is usage scope. If code reads the option across front-end requests, REST requests, cron work, and admin screens, autoload may be justified. If the value is only used on one settings screen or one maintenance task, autoload deserves closer review.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check whether the row is a transient
&lt;/h3&gt;

&lt;p&gt;Without a persistent object cache, the Transients API stores transient data in the database, normally in &lt;code&gt;wp_options&lt;/code&gt;. Names commonly begin with &lt;code&gt;_transient_&lt;/code&gt; or &lt;code&gt;_site_transient_&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Current WordPress behavior matters here. A transient created without an expiration is autoloaded. A transient created with an expiration is not autoloaded by default.&lt;/p&gt;

&lt;p&gt;With a persistent object cache, WordPress can store transient values in that cache instead of &lt;code&gt;wp_options&lt;/code&gt;. If you are reviewing a site without one, the &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-redis-object-cache" rel="noopener noreferrer"&gt;Redis object cache guide&lt;/a&gt; explains where persistent object caching fits into WordPress performance.&lt;/p&gt;

&lt;p&gt;Do not delete a transient or option simply because it is large. Confirm which code owns it and whether deletion is part of that component's supported lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to change autoload safely
&lt;/h2&gt;

&lt;p&gt;Changing the autoload flag is safer than deleting an attributed option because the stored value remains available through normal option reads. It can still affect application behavior, so make the change like any other production database change.&lt;/p&gt;

&lt;p&gt;Use this sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Back up the database before changing option metadata.&lt;/li&gt;
&lt;li&gt;Reproduce the site on staging with the same plugins, theme, and relevant configuration.&lt;/li&gt;
&lt;li&gt;Attribute the option to the code that owns it.&lt;/li&gt;
&lt;li&gt;Confirm that the option is not needed across most requests.&lt;/li&gt;
&lt;li&gt;Change one option at a time, then test the paths that use it.&lt;/li&gt;
&lt;li&gt;Re-run the SQL measurement and confirm the expected row moved out of the autoload set.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Never delete an option you cannot attribute. A stale-looking row can still be read by code that is not obvious from the option name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the WordPress API in PHP
&lt;/h3&gt;

&lt;p&gt;WordPress introduced &lt;a href="https://developer.wordpress.org/reference/functions/wp_set_option_autoload/" rel="noopener noreferrer"&gt;&lt;code&gt;wp_set_option_autoload()&lt;/code&gt; in 6.4&lt;/a&gt;. It changes the autoload value without changing the option value and handles the related option caches.&lt;/p&gt;

&lt;p&gt;Pass a boolean in current code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;span class="nf"&gt;wp_set_option_autoload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'acme_plugin_settings'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;false&lt;/code&gt; only after confirming the option does not need to be loaded with the common &lt;code&gt;alloptions&lt;/code&gt; set. If the plugin later calls &lt;code&gt;get_option( 'acme_plugin_settings' )&lt;/code&gt;, WordPress can still fetch the value separately.&lt;/p&gt;

&lt;p&gt;For code that creates or updates its own options, pass an explicit boolean when you know the intended behavior. Do not rely on a cleanup script to correct a plugin that keeps writing the wrong autoload choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use WP-CLI for a single option
&lt;/h3&gt;

&lt;p&gt;Current WP-CLI includes &lt;a href="https://developer.wordpress.org/cli/commands/option/set-autoload/" rel="noopener noreferrer"&gt;&lt;code&gt;wp option set-autoload&lt;/code&gt;&lt;/a&gt;. To stop autoloading one attributed option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp option set-autoload acme_plugin_settings off
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command accepts &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;off&lt;/code&gt;, &lt;code&gt;yes&lt;/code&gt;, and &lt;code&gt;no&lt;/code&gt;. Use &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt; for current WordPress-style values.&lt;/p&gt;

&lt;p&gt;Do not use a raw &lt;code&gt;UPDATE wp_options SET autoload=...&lt;/code&gt; statement in a cleanup script. Prefer the core PHP API, or the WP-CLI command when you are changing an attributed option interactively.&lt;/p&gt;

&lt;p&gt;After the change, test the feature that owns the option, normal front-end requests, relevant admin screens, scheduled tasks that depend on it, and any request path where the option is read.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do next
&lt;/h2&gt;

&lt;p&gt;If autoload is only one part of a slow back end, continue with the &lt;a href="https://hamzaahmadaslam.com/blog/fix-slow-wordpress-admin" rel="noopener noreferrer"&gt;slow WordPress admin diagnosis guide&lt;/a&gt;. It helps separate option loading from slow queries, HTTP calls, cron work, and plugin-specific admin behavior.&lt;/p&gt;

&lt;p&gt;If you have a large database, persistent cache concerns, or several interacting bottlenecks, the &lt;a href="https://hamzaahmadaslam.com/services/wordpress-performance-optimization" rel="noopener noreferrer"&gt;WordPress performance optimization service&lt;/a&gt; covers profiling and remediation at the application and database layers.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>wpoptions</category>
      <category>mysql</category>
      <category>wpcli</category>
    </item>
    <item>
      <title>Audit WordPress third party scripts without breaking key flows</title>
      <dc:creator>Hamza Ahmad Aslam</dc:creator>
      <pubDate>Sat, 14 Nov 2026 14:00:30 +0000</pubDate>
      <link>https://dev.to/hamzaahmadaslam/audit-wordpress-third-party-scripts-without-breaking-key-flows-469o</link>
      <guid>https://dev.to/hamzaahmadaslam/audit-wordpress-third-party-scripts-without-breaking-key-flows-469o</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-third-party-scripts" rel="noopener noreferrer"&gt;hamzaahmadaslam.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How this article was made: drafted with AI assistance from a researched brief, then checked against primary documentation before publishing.&lt;/p&gt;

&lt;p&gt;To audit WordPress third party scripts, start by listing every external dependency and the business owner who still needs it, then measure its network and main-thread cost. Change one dependency at a time, compare the same page and user flow, and retest consent, forms, analytics, and checkout before you remove or delay anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a WordPress third party scripts inventory first
&lt;/h2&gt;

&lt;p&gt;Third-party JavaScript is code you did not author and that is served by another provider. It can add network requests, CPU work, rendering delays, and dependencies on servers you do not control. Google’s &lt;a href="https://web.dev/articles/third-party-javascript" rel="noopener noreferrer"&gt;third-party JavaScript performance guide&lt;/a&gt; also recommends routine audits and removing redundant providers.&lt;/p&gt;

&lt;p&gt;Do not stop at the domain name. Record who added the dependency, who owns its business purpose, and what would fail if it disappeared. A marketing pixel with no current campaign owner deserves a different decision from a payment script that checkout needs.&lt;/p&gt;

&lt;p&gt;Use this worksheet as the working record. The rows are blank on purpose so your measurements are your own.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Provider or script&lt;/th&gt;
&lt;th&gt;Domain or host&lt;/th&gt;
&lt;th&gt;Added by&lt;/th&gt;
&lt;th&gt;Business owner&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Pages or trigger&lt;/th&gt;
&lt;th&gt;Depends on&lt;/th&gt;
&lt;th&gt;Transfer size&lt;/th&gt;
&lt;th&gt;Main-thread time&lt;/th&gt;
&lt;th&gt;Candidate action&lt;/th&gt;
&lt;th&gt;Proof required&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Keep / remove / conditional / delay&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Keep / remove / conditional / delay&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Keep / remove / conditional / delay&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Start with the pages that matter to the business: the home page, a key landing page, a form page, a product page, cart, checkout, and the order confirmation page where applicable. Add other routes when a script appears only there.&lt;/p&gt;

&lt;p&gt;The “Added by” field matters because an external request can come from a plugin, theme, tag manager, embedded widget, custom snippet, or another third-party script. The “Business owner” field names the person who can confirm the tool is still needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find every external request and its initiator
&lt;/h2&gt;

&lt;p&gt;Open Chrome DevTools, load the page, then use the Network panel. The Network panel’s More filters &amp;gt; 3rd-party requests option shows requests whose origin differs from the page’s origin. That list can include your own CDN or subdomains, so confirm who operates each domain before you add it to the inventory. Its request table can also show Domain, Initiator, Size, Time, and the Waterfall, which makes it useful for building the inventory. See the current &lt;a href="https://developer.chrome.com/docs/devtools/network/reference" rel="noopener noreferrer"&gt;Network panel reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For a controlled first-load comparison, use the same browser, page, login state, consent state, network setting, and cache setting for both variants. If you use DevTools’ Disable cache setting, keep it enabled for both runs. Do not compare a cold baseline with a warm-cache candidate.&lt;/p&gt;

&lt;p&gt;Work through each third-party request:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Record the domain and request name.&lt;/li&gt;
&lt;li&gt;Check Initiator to find what caused the request.&lt;/li&gt;
&lt;li&gt;Group related requests under one provider or business dependency.&lt;/li&gt;
&lt;li&gt;Record transferred size and request timing.&lt;/li&gt;
&lt;li&gt;Follow the page’s normal user flow so late requests also appear.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A tag manager is a common source of indirection. Google Tag Manager can deploy Google and third-party tags from one container, so &lt;code&gt;gtm.js&lt;/code&gt; is only the loader you see first. Inventory the tags it causes to fire as separate dependencies, not as one generic “GTM” row. Google’s &lt;a href="https://developers.google.com/tag-platform/tag-manager" rel="noopener noreferrer"&gt;Tag Manager overview&lt;/a&gt; describes the container as a system for configuring and deploying tags.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure network cost and main-thread execution separately
&lt;/h2&gt;

&lt;p&gt;A large download and a CPU-heavy script are different problems. Record both.&lt;/p&gt;

&lt;p&gt;In the Network panel, compare transfer size, request duration, request order, and dependencies in the waterfall. A provider that makes many follow-up requests may cost more than its first JavaScript file suggests.&lt;/p&gt;

&lt;p&gt;Then record the same page and user flow in the Performance panel. The current panel can show first-party and third-party entities, transfer size, and main-thread time for the selected range. Chrome 134 added the first-party and third-party summary table and the “Dim 3rd parties” control. The current &lt;a href="https://developer.chrome.com/docs/devtools/performance/reference" rel="noopener noreferrer"&gt;Performance panel reference&lt;/a&gt; shows how to inspect that data.&lt;/p&gt;

&lt;p&gt;Main-thread time matters because JavaScript work can delay input handling. Google’s &lt;a href="https://web.dev/articles/optimize-inp" rel="noopener noreferrer"&gt;INP optimization guide&lt;/a&gt; explains that script loading, parsing, compiling, and other work can contribute to input delay.&lt;/p&gt;

&lt;p&gt;Do not turn this audit into a full INP investigation. If a specific click or typing interaction remains slow after you reduce third-party work, continue with &lt;a href="https://hamzaahmadaslam.com/blog/fix-inp-wordpress" rel="noopener noreferrer"&gt;finding the interaction behind poor WordPress INP&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat unused JavaScript as a clue, not a removal verdict
&lt;/h2&gt;

&lt;p&gt;Chrome’s Coverage panel records used and unused bytes while you load and interact with a page. It is useful for finding files that ship much more code than the tested flow executes. The &lt;a href="https://developer.chrome.com/docs/devtools/coverage" rel="noopener noreferrer"&gt;Coverage documentation&lt;/a&gt; explains that recording continues while you interact with the page.&lt;/p&gt;

&lt;p&gt;That result is scoped to what you exercised. Code marked unused on a landing page may run after consent changes, a form error, a video play, a cart update, or another route.&lt;/p&gt;

&lt;p&gt;For unused JavaScript on WordPress, pair Coverage with ownership and flow testing. A file becomes a removal candidate only after you can answer three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which feature or measurement does it support?&lt;/li&gt;
&lt;li&gt;Which pages and states require it?&lt;/li&gt;
&lt;li&gt;Which owner still needs the result?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If nobody can answer the purpose, mark the row “owner unknown” instead of deleting it on production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test one removal or loading change at a time
&lt;/h2&gt;

&lt;p&gt;A useful way to audit marketing scripts in WordPress is to change one dependency, then rerun the same measurement and business tests. Changing several tags together makes attribution weak because you cannot tell which change improved the waterfall or broke a flow.&lt;/p&gt;

&lt;p&gt;Use staging or another controlled environment when removal can affect revenue, consent behavior, or data collection. For each candidate, choose one action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove it when the owner confirms the purpose has ended.&lt;/li&gt;
&lt;li&gt;Load it only on routes where the feature is used.&lt;/li&gt;
&lt;li&gt;Narrow a tag-manager trigger when a tag only belongs to a specific page or event.&lt;/li&gt;
&lt;li&gt;Delay it only when its timing is not required for the user flow or measurement you still need.&lt;/li&gt;
&lt;li&gt;Keep it when the business function depends on it and the cost is accepted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When third-party scripts make a WordPress site slow, start with code that has weak business value and measurable browser cost, not whichever domain appears first in a report.&lt;/p&gt;

&lt;p&gt;If you are checking WordPress Tag Manager performance, inspect the tags inside the container before you try to delay the container itself. A smaller set of active tags and tighter firing rules gives you a clearer system to test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare waterfalls with a controlled worksheet
&lt;/h2&gt;

&lt;p&gt;Use the same page, flow, cache state, consent state, and test setup for baseline and candidate runs. Make one code or configuration change between them.&lt;/p&gt;

&lt;p&gt;Copy this comparison table into the ticket or pull request:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Dependency changed&lt;/th&gt;
&lt;th&gt;Page and flow&lt;/th&gt;
&lt;th&gt;Baseline requests&lt;/th&gt;
&lt;th&gt;Candidate requests&lt;/th&gt;
&lt;th&gt;Baseline transfer&lt;/th&gt;
&lt;th&gt;Candidate transfer&lt;/th&gt;
&lt;th&gt;Baseline main-thread time&lt;/th&gt;
&lt;th&gt;Candidate main-thread time&lt;/th&gt;
&lt;th&gt;Expected result&lt;/th&gt;
&lt;th&gt;Business checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Fewer requests or less work without lost function&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use these formulas when you summarize a comparison:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request delta = candidate request count - baseline request count
Transfer delta = candidate transferred bytes - baseline transferred bytes
Main-thread delta = candidate main-thread time - baseline main-thread time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Negative values mean the candidate used fewer requests, fewer transferred bytes, or less main-thread time. Do not treat one faster waterfall as proof by itself. The change still has to pass the business checks below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify consent, forms, tracking, and checkout after every change
&lt;/h2&gt;

&lt;p&gt;A dependency is removable only within the scope you tested. Report that scope in the change record.&lt;/p&gt;

&lt;p&gt;Use this test matrix after each removal, conditional-load rule, or delay:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flow&lt;/th&gt;
&lt;th&gt;What to do&lt;/th&gt;
&lt;th&gt;Expected result&lt;/th&gt;
&lt;th&gt;Pass or fail&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Consent&lt;/td&gt;
&lt;td&gt;Load with a fresh consent state, change the choice, then continue browsing&lt;/td&gt;
&lt;td&gt;Tags that should wait for consent remain inactive until the allowed state; required site behavior still works&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forms&lt;/td&gt;
&lt;td&gt;Load, trigger validation, submit valid data, reach the success state&lt;/td&gt;
&lt;td&gt;Validation, submission, success UI, and required tracking still work&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tracking&lt;/td&gt;
&lt;td&gt;Visit the target page and complete the tracked action&lt;/td&gt;
&lt;td&gt;The expected analytics or marketing event is still sent once, at the intended step&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Checkout&lt;/td&gt;
&lt;td&gt;Add an item, reach checkout, complete the configured test purchase flow, and reach confirmation&lt;/td&gt;
&lt;td&gt;Cart, checkout UI, payment test flow, order creation, and required measurement still work&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Add any site-specific flow that the dependency touches, such as chat, booking, video, search, account login, or lead routing. Record the flows you tested instead of using a generic “regression tested” note.&lt;/p&gt;

&lt;p&gt;Late-loading widgets and embeds can also move page content. If a loading change creates visual movement, use &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-layout-shift" rel="noopener noreferrer"&gt;finding the element that causes layout shifts in WordPress&lt;/a&gt; rather than treating that as a script-inventory problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide which scripts can be removed
&lt;/h2&gt;

&lt;p&gt;Do not classify scripts by brand. Classify each dependency by purpose, ownership, cost, and test evidence.&lt;/p&gt;

&lt;p&gt;A strong removal candidate has all of these traits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No current business owner needs its output.&lt;/li&gt;
&lt;li&gt;No required feature depends on it.&lt;/li&gt;
&lt;li&gt;It is absent from the flows where it was expected to matter.&lt;/li&gt;
&lt;li&gt;The controlled candidate run reduces network or main-thread work.&lt;/li&gt;
&lt;li&gt;Consent, forms, tracking, checkout, and other affected flows still produce the expected result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A script with high cost but an active business purpose may need conditional loading instead. A low-cost script with no owner or purpose can still be clutter worth removing.&lt;/p&gt;

&lt;p&gt;Deferring a script is also a behavior change. Analytics can miss early events, consent logic can run in the wrong order, and UI code can appear late if timing changes. Treat defer or delay rules as experiments with the same verification matrix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the audit result for the next fix
&lt;/h2&gt;

&lt;p&gt;If the dependency belongs to your own front-end code rather than an external provider, move that work to the codebase and follow the site’s guide to &lt;a href="https://hamzaahmadaslam.com/blog/wordpress-script-modules" rel="noopener noreferrer"&gt;loading ES modules with WordPress Script Modules&lt;/a&gt;. Keep this audit focused on ownership, external dependencies, and removal decisions.&lt;/p&gt;

&lt;p&gt;If the remaining problem spans third-party code, theme work, plugins, and measurement across key routes, &lt;a href="https://hamzaahmadaslam.com/services/wordpress-performance-optimization" rel="noopener noreferrer"&gt;WordPress performance optimization&lt;/a&gt; can take the audit through implementation without mixing this inventory with unrelated performance work.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>performance</category>
      <category>javascript</category>
      <category>corewebvitals</category>
    </item>
  </channel>
</rss>
