promptunit

INP Fixer: Make Your Site React Faster to Clicks

Buttons that freeze for a moment, menus that open late and filters that lag all hurt your INP score and your sales. This prompt finds which clicks are slow, why they're slow (usually too much JavaScript) and gives your developers a clear fix plan.

Works in ChatGPTClaudeGemini626 words6 inputs to fillSEO-043

Example input

This is exactly what we gave the model. You replace it with your own details.

- Website: https://www.example.com (kitchenware store)
- Platform, theme and framework: WordPress + WooCommerce + Elementor, 31 plugins
- Third-party scripts: Live chat widget, product reviews widget, Google Tag Manager with 14 tags, Hotjar, an A/B testing tool, Facebook pixel, a 'recently viewed' popup plugin
- INP field data (CrUX or Search Console) for mobile and desktop: INP p75: mobile 410 ms, desktop 190 ms
- Slow interactions I notice: Add to cart button on product pages, the filter sidebar on category pages, the mobile menu
- Optional: Performance panel trace summary or long task list: Clicking 'Add to cart' on mobile: input delay 180 ms (main thread busy with a long task from the A/B testing script), processing 140 ms (WooCommerce cart fragments refresh + 3 click listeners from tag manager), presentation delay 95 ms (DOM has 3,900 elements).

Real output

Pasted straight from the model. We did not fix a word.

INP fix plan: your WooCommerce kitchenware store

Quick read

  • Mobile INP p75 is 410 ms, which "needs improvement". Good is 200 ms or less. Desktop is 190 ms, which is good but only 10 ms under the line.
  • Your Add to cart trace adds up to 415 ms (180 + 140 + 95). That is almost exactly your mobile p75, so Add to cart is a good picture of your typical slow tap.
  • All three parts are too high. Input delay (180 ms) is the biggest, and one script causes it: the A/B testing tool.
  • WooCommerce is not what holds you back. 88% of WooCommerce sites had good INP in July 2025. Your gap comes from extra scripts, GTM click listeners and a 3,900-element page.

Questions (with my best guesses, which I use below)

  1. Which A/B testing tool is it, and is a test live on product or category pages right now? Guess: a client-side tool that loads on every page in the <head>, with no live test on most product pages.
  2. Does Add to cart on product pages work by AJAX (no page reload), with a mini cart in the header? Guess: yes. AJAX add to cart plus an Elementor Menu Cart in the header, which is why cart fragments run.
  3. Which plugin runs the category filter sidebar, and does it re-filter on every tap? Guess: an AJAX filter plugin in "instant" mode, with a price slider.
  4. Do you have a speed plugin (WP Rocket, Perfmatters, FlyingPress, LiteSpeed Cache) with "Delay JavaScript" turned on? Guess: you have a caching plugin, but JS delay is off.
  5. How is the mobile menu built? Guess: Elementor's Nav Menu widget (or a mega menu plugin) holding the full category tree, plus separate desktop and mobile headers that hide each other with Elementor's responsive visibility.

Step 1: Find and reproduce the slow interactions

Field data tells you which pages are slow

  • PageSpeed Insights: check field data for your whole site (origin), one product URL and one category URL.
  • Search Console > Core Web Vitals > Mobile: open the INP issue. It groups similar URLs, such as product pages and category pages.
  • Neither tool tells you which button is slow. Real user monitoring (RUM) does.

RUM tells you which button is slow, and why

  • Add Snippet 1 (below). It uses the attribution build of the web-vitals library. For each page view it sends INP to GA4 through GTM, with the element tapped, the 3 parts, the load state and the slowest script.
  • After 7 days, rank inp_target by the number of "needs-improvement" and "poor" events, split by page type. That is your real list of slowest interactions.
  • Watch inp_load_state. If many slow taps happen while the page is still loading or dom-interactive, the startup scripts (A/B tool, chat, Hotjar) are to blame.

Reproduce in Chrome DevTools

  1. Open a product page in Chrome, then DevTools > Performance panel.
  2. Turn on mobile device emulation and set CPU throttling to 4x slowdown (6x to copy low-end phones).
  3. The Live metrics view shows INP and an interaction log while you tap. Tap Add to cart, a few filter checkboxes and the menu button.
  4. Test each tap twice: once right after the page appears (still loading) and once after it settles. Your shoppers do both.
  5. Click Record, tap, then stop. In the Interactions track, hover the interaction to see input delay, processing and presentation delay. Click the long task in the Main track, open Bottom-up and group by domain to see which script owns the time.
  6. Confirm on a real mid-range Android phone with remote debugging (chrome://inspect).

Lighthouse's default test can't show INP because it doesn't click anything. Its Total Blocking Time is only a rough hint.

1. Slow interactions

InteractionINPBiggest partCauseFix
Add to cart, product page (mobile)~415 ms in your trace, matching field p75 of 410 ms (needs improvement)Input delay: 180 ms (then processing 140 ms, presentation 95 ms)Input delay: a long task from the A/B testing script is running when the shopper taps. Processing: cart fragments refresh plus 3 GTM click listeners. Presentation: after the cart HTML is swapped, the browser restyles and re-lays out a 3,900-element page.Load the A/B script only where a test is live. Move GTM tags off click triggers. Show instant button feedback. Slim the cart fragment work. Cut DOM size. Target after fixes: about 140-180 ms (estimate).
Filter sidebar, category page (mobile)Not measured yet. Guess: 300-500+ msGuess: processing + presentationGuess: the filter plugin runs on every tap and swaps the whole product grid and sidebar. Elementor, review stars and GTM then re-run on the new HTML. The price slider may fire on every move. The grid DOM is large.Apply button on mobile. Instant feedback. Debounce the slider. Swap only the grid. Fewer products per page. content-visibility on product cards.
Mobile menu open (mobile)Not measured yet. Guess: 250-400 msGuess: input delay (tapped while third-party scripts still load) and presentation (a big hidden menu appears)Guess: the full category tree sits inside the menu, it opens with a JS slide or height animation, and hidden duplicate headers add to the DOM.Delay third-party scripts. Shrink the menu. Use a CSS transform transition. Remove the hidden duplicate header.

Desktop (190 ms) has the same causes, just on a faster CPU. The same fixes give it safe headroom.

2. Third-party script decisions

ScriptPurposeCostKeep/Delay/Replace/Remove
A/B testing toolRuns experimentsMeasured: its long task is the 180 ms input delay on Add to cart. Tools like this usually load early in the <head> and keep watching the page.Remove from product and category pages unless a test is live there. Remove it fully if no test is planned. Later, Replace with server-side testing.
Google Tag Manager (14 tags)Loads analytics and ad tagsMeasured: 3 click listeners inside the 140 ms processing time. Every tag also adds main-thread work during load.Keep, but trim it. Fire ecommerce tags on a dataLayer event, not a click. Delete unused tags and triggers.
Facebook pixelAd tracking and conversionsGuess: medium. Its automatic button-click tracking adds yet another click listener. It may be loaded twice (plugin + GTM). Please check.Keep, but install it once only, send AddToCart from the dataLayer event, and turn off automatic button-click tracking. Add the server-side Conversions API through Meta's official WooCommerce integration if you don't have it yet.
HotjarHeatmaps and session recordingsGuess: high. Recording watches every DOM change, click and key press, which is costly on a 3,900-element page.Remove when no study is running. During a study, Delay it (Snippet 4) and limit it to a few pages.
Live chat widgetCustomer supportGuess: high. A large script and iframe load early on every page.Delay: load it 10 seconds after page load, or when the shopper taps a light "Chat" button (Snippet 4).
Product reviews widgetStars and reviews (trust, SEO)Guess: medium. JS builds stars on every product card and the review list on product pages.Keep, but Delay the review list until it is near the screen. On category pages, use server-rendered stars, or none.
'Recently viewed' popup pluginBrings back products the shopper viewedGuess: medium. It runs on every page and adds a popup, timers and DOM. Popups also cover small screens.Remove. Replace it with WooCommerce's built-in Recently Viewed Products widget placed on the page (server-rendered, no popup).
WooCommerce cart fragments (plugin script, not third-party)Keeps the header cart count and mini cart in syncMeasured: part of the 140 ms processing. Its HTML swap also adds to presentation delay.Keep, but slim it (fix 5).
Your other plugins (31 in total)VariousUnknown. Each one can add JS and CSS to every page.Audit them. Unload scripts per page type and Remove unused plugins (fix 9).

To check any "Guess" cost: in DevTools, tap during page load, then group Bottom-up by domain. You can also read inp_top_script from Snippet 1.

3. Ranked fix list

Effort: Low = under 2 hours. Medium = half a day to 2 days. High = several days or a developer.

  1. Load the A/B testing script only where a test is live. Effort: Low. Helps: all three interactions (input delay).

    • Use Snippet 2, the tool's own page targeting, a GTM exception, or Elementor Pro > Custom Code display conditions, depending on how the script is installed.
    • If no test has run in the last 3 months, remove the tool completely.
    • Expected gain: the biggest single win. It could remove most of the 180 ms input delay on product pages (estimate).
  2. Take GTM off the click path. Effort: Low-Medium (2-4 hours with testing). Helps: Add to cart processing.

    • Switch the 3 click-triggered tags to fire on the cart_updated event from Snippet 3.
    • If any of the 3 is a Custom HTML tag that adds its own click listener, rewrite it to listen for cart_updated instead.
    • Delete click triggers that no tag needs, and dead or duplicate tags among the 14.
    • Avoid Element Visibility triggers with "Observe DOM changes" turned on. They are costly on a 3,900-element page.
    • In Meta Events Manager > your pixel > Settings, turn off automatic event tracking for button clicks, since you send AddToCart yourself.
  3. Delay or remove the heavy extras. Effort: Low-Medium. Helps: input delay on all three, mainly taps during page load.

    • Hotjar: remove it, or delay it during studies only (Snippet 4).
    • Live chat: delay it, or load it on tap (Snippet 4).
    • Recently viewed popup: deactivate it. Add WooCommerce's Recently Viewed Products widget under the product content instead (in Elementor, it's in the WordPress widgets list).
    • Reviews: turn on the plugin's lazy-load option if it has one (guess). Use server-rendered stars on category pages.
    • Warning: "delay until user interaction" features in speed plugins run the delayed scripts right after the first tap or scroll, so the cost can land on the shopper's next tap. For heavy scripts, a timer after page load (Snippet 4) is safer.
  4. Instant feedback on Add to cart, then yield. Effort: Low. Helps: Add to cart.

    • Snippet 3 adds a CSS spinner at once, and sends analytics only after the cart update and after a yield.
    • The browser only paints the spinner after every click handler finishes. So this works best after fixes 1 and 2.
    • You can't break up a third-party script's long task yourself. For those, removing or delaying the script (fixes 1 and 3) is the fix.
  5. Slim the cart fragment work. Effort: Medium. Helps: Add to cart processing and presentation.

    • Run Snippet 6C. If you see more than one fragment refresh per add, two plugins are triggering it (guess: a side cart or the recently viewed popup).
    • Your trace shows the refresh running inside the click. In the trace, click that task and check which script started it. Usually a plugin, not WooCommerce itself, causes this.
    • Keep the header mini cart HTML small: a count and subtotal, few or no images.
    • Don't add plugins that "refresh the cart" on every page.
  6. Fix the filter sidebar. Effort: Medium. Helps: the filter.

    • Turn on the plugin's "Apply / Filter button" mode for mobile. Each checkbox tap is then just a cheap native checkbox, and the heavy work runs once.
    • Price slider: update on release, or debounce it to about 300 ms.
    • Show a loading overlay on the grid right away, then fetch the results.
    • Replace only the product grid, not the sidebar or the whole page.
    • Show 12-16 products per page on mobile, and use pagination, not infinite scroll (infinite scroll keeps growing the DOM).
    • Add content-visibility to product cards (Snippet 5B).
    • If your plugin can't do these, replace it with one that can.
  7. Fix the mobile menu. Effort: Medium. Helps: the mobile menu.

    • Show only top-level categories and a few key links. Link to category pages instead of nesting every subcategory.
    • Open and close it with a CSS transform transition (Snippet 5C), not a JS height or slide animation.
    • Use one responsive header instead of separate desktop and mobile headers. Hidden Elementor elements still sit in the DOM.
  8. Cut DOM size from 3,900 to under about 1,500 elements. Effort: Medium-High. Helps: presentation delay on every interaction (the 95 ms part).

    • Run Snippet 6A and 6B to see which blocks hold the most elements and how many are hidden.
    • Convert Elementor sections and columns to Flexbox Containers (fewer wrapper divs).
    • Remove hidden desktop/mobile duplicates. Shorten mega menu and footer link lists. Drop spacer, divider and icon-list widgets where plain text works.
    • Add content-visibility: auto to far-below-the-fold sections (Snippet 5A).
    • Lighthouse warns above about 1,400 elements, so under ~1,500 is a realistic Elementor target.
  9. Audit plugins and load JS only where it's used. Effort: Medium. Helps: input delay everywhere.

    • Install Query Monitor for a short time. Its Scripts panel shows which plugin adds which script on each page type.
    • Use Asset CleanUp or Perfmatters to unload plugin scripts where they aren't used (for example, form scripts on product pages). Delete plugins you don't need.
    • Note: "lazy hydration" doesn't apply to you. A classic WordPress + Elementor page isn't hydrated by a JS framework. The matching fix is loading each script only on the pages that use it.

4. Code snippets

How to add every snippet safely

  • Test on a staging copy first and take a full backup.
  • PHP snippets: use the free Code Snippets plugin (Snippets > Add New > choose "Only run on site front-end" > paste > Save and Activate). Or paste them at the end of your child theme's functions.php, never the parent theme's, because updates wipe it. The snippets have no opening <?php tag on purpose.
  • CSS: Appearance > Customize > Additional CSS, or Elementor > Site Settings > Custom CSS.
  • JavaScript is added with a wp_footer hook inside the PHP snippets, so you don't need extra files.
  • After each change, clear your page cache and CDN cache, then test as a logged-out visitor.
  • If your speed plugin delays or combines JS, exclude these new inline scripts so they run on time.

Snippet 1: Real user monitoring for INP (web-vitals attribution, sent to GA4 through GTM)

Where: PHP snippet (Code Snippets, front-end only) or the end of your child theme's functions.php. It prints a small module script in the footer of every page.

/**
 * INP real-user monitoring: web-vitals (attribution build) -> dataLayer -> GTM -> GA4.
 */
add_action( 'wp_footer', function () {
	$page_type = 'other';
	if ( function_exists( 'is_product' ) ) {
		if ( is_product() ) {
			$page_type = 'product';
		} elseif ( is_shop() || is_product_category() || is_product_tag() ) {
			$page_type = 'category';
		} elseif ( is_cart() || is_checkout() ) {
			$page_type = 'cart_checkout';
		}
	}
	?>
	<script type="module">
	import { onINP } from 'https://unpkg.com/web-vitals@5/dist/web-vitals.attribution.js?module';

	onINP(function (metric) {
		var a = metric.attribution || {};
		var topScript = '';
		var topMs = 0;
		(a.longAnimationFrameEntries || []).forEach(function (frame) {
			(frame.scripts || []).forEach(function (s) {
				if (s.duration > topMs) {
					topMs = s.duration;
					topScript = (s.sourceURL || s.invoker || '').split('?')[0];
				}
			});
		});
		window.dataLayer = window.dataLayer || [];
		window.dataLayer.push({
			event: 'web_vitals_inp',
			inp_value: Math.round(metric.value),
			inp_rating: metric.rating,
			inp_target: String(a.interactionTarget || '').slice(0, 100),
			inp_type: a.interactionType || '',
			inp_load_state: a.loadState || '',
			inp_input_delay: Math.round(a.inputDelay || 0),
			inp_processing: Math.round(a.processingDuration || 0),
			inp_presentation: Math.round(a.presentationDelay || 0),
			inp_top_script: topScript.slice(-100),
			inp_top_script_ms: Math.round(topMs),
			page_type: '<?php echo esc_js( $page_type ); ?>'
		});
	});
	</script>
	<?php
}, 100 );

Then in GTM:

  1. Create a Data Layer Variable for each key above (inp_value, inp_rating, inp_target, and so on).
  2. Create a Custom Event trigger named web_vitals_inp.
  3. Create a GA4 Event tag named inp, add the variables as event parameters, and use that trigger.
  4. In GA4 > Admin > Custom definitions, add event-scoped custom dimensions for the text fields, and custom metrics (milliseconds) for the numbers.
  5. GA4 can't easily show a p75. Rank targets by the count of events where inp_rating isn't "good", or turn on the free BigQuery export for exact p75 numbers.

Optional: download the web-vitals file and serve it from your own site instead of unpkg.

Snippet 2: Load the A/B testing script only where a test is live

Where: PHP snippet (Code Snippets, front-end only) or child theme functions.php. Use it only if the A/B tool is installed by a WordPress plugin. Find the real script handle in Query Monitor > Scripts, then replace REPLACE-WITH-AB-HANDLE. If the tool lives in GTM, add an exception trigger for product and category paths instead. If it's in Elementor Pro > Custom Code, change the display conditions there.

/**
 * Load the A/B testing script only on product pages that have a live test.
 */
add_action( 'wp_enqueue_scripts', function () {
	if ( ! function_exists( 'is_product' ) ) {
		return;
	}

	// Product IDs with a live experiment. Keep this list up to date.
	$live_test_product_ids = array(); // example: array( 1234, 5678 )

	if ( is_product() && in_array( get_queried_object_id(), $live_test_product_ids, true ) ) {
		return; // keep the tool where a test is running
	}

	if ( is_product() || is_shop() || is_product_category() || is_product_tag() ) {
		wp_dequeue_script( 'REPLACE-WITH-AB-HANDLE' );
	}
}, 100 );

Safety: many A/B tools also add an "anti-flicker" snippet that hides the page until the tool loads. Remove it on the same pages, or those pages will stay blank until its timeout runs out. If the plugin prints its code straight into the <head> instead of enqueueing it, this snippet won't work. Use the plugin's page settings instead.

Snippet 3: Add to cart, with instant feedback and analytics after the cart update

Where: PHP snippet (Code Snippets, front-end only) or child theme functions.php. It runs only on product, shop and category pages. Put the CSS in Additional CSS. Then, in GTM, change the 3 click-triggered tags to fire on the Custom Event cart_updated, pause the old click triggers, and test in Preview mode.

/**
 * Add to cart: instant visual feedback on tap, analytics after the cart update.
 */
add_action( 'wp_footer', function () {
	if ( ! function_exists( 'is_product' ) ) {
		return;
	}
	if ( ! ( is_product() || is_shop() || is_product_category() || is_product_tag() ) ) {
		return;
	}
	?>
	<script>
	(function ($) {
		if (!$) { return; }

		// Lets the browser paint before less urgent work.
		function yieldToMain() {
			if (window.scheduler && typeof window.scheduler.yield === 'function') {
				return window.scheduler.yield();
			}
			return new Promise(function (resolve) { setTimeout(resolve, 0); });
		}

		// 1) Instant feedback: tiny work, no layout reads, runs first (capture phase).
		document.addEventListener('click', function (e) {
			var btn = e.target.closest('.single_add_to_cart_button, .add_to_cart_button');
			if (!btn || btn.classList.contains('disabled')) { return; }
			btn.classList.add('is-adding');
			setTimeout(function () { btn.classList.remove('is-adding'); }, 8000); // safety reset
		}, true);

		// 2) After WooCommerce confirms the AJAX add to cart:
		//    let the cart update paint first, then hand the event to GTM.
		$(document.body).on('added_to_cart', function (event, fragments, cartHash, $button) {
			if ($button && $button.length) { $button.removeClass('is-adding'); }
			yieldToMain().then(function () {
				window.dataLayer = window.dataLayer || [];
				window.dataLayer.push({
					event: 'cart_updated',
					product_id: ($button && $button.length) ? String($button.data('product_id') || $button.val() || '') : ''
				});
			});
		});
	})(window.jQuery);
	</script>
	<?php
}, 100 );
/* Add to cart "working" state, animated with CSS only (no JS animation) */
.single_add_to_cart_button.is-adding,
.add_to_cart_button.is-adding {
	position: relative;
	opacity: .7;
	pointer-events: none; /* stops double taps */
}
.single_add_to_cart_button.is-adding::after,
.add_to_cart_button.is-adding::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 12px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: inp-spin .6s linear infinite;
}
@keyframes inp-spin { to { transform: rotate(360deg); } }

Notes

  • If a plugin such as GTM4WP already pushes an add_to_cart dataLayer event with product data, fire your tags on that event and delete the dataLayer.push part here.
  • Firing tags after the cart update also gives cleaner data, because only successful adds are counted.
  • If your product pages reload the page on Add to cart (no AJAX), added_to_cart won't fire there. The spinner still works.
  • If your theme already shows a spinner (WooCommerce adds a loading class to shop buttons), keep only one.

Snippet 4: Load Hotjar and live chat after the page settles

Where: PHP snippet (Code Snippets, front-end only) or child theme functions.php. First remove the current installs (pause the GTM tags, deactivate the plugins, or remove the header code) so the scripts don't load twice. Then paste each vendor's own install code (without the <script> tags) into the two marked spots.

/**
 * Load Hotjar and live chat after the page has settled, not during load.
 */
add_action( 'wp_footer', function () {
	?>
	<script>
	(function () {
		function whenIdle(fn) {
			if ('requestIdleCallback' in window) {
				requestIdleCallback(fn, { timeout: 5000 });
			} else {
				setTimeout(fn, 2000);
			}
		}

		function loadHotjar() {
			// Paste your Hotjar tracking code here (without <script> tags).
		}

		var chatLoaded = false;
		function loadChat() {
			if (chatLoaded) { return; }
			chatLoaded = true;
			// Paste your live chat install code here (without <script> tags).
		}

		window.addEventListener('load', function () {
			setTimeout(function () { whenIdle(loadHotjar); }, 5000);
			setTimeout(function () { whenIdle(loadChat); }, 10000);
		});

		// Optional: a light "Chat" button (CSS class "chat-facade") loads the real widget on tap.
		document.addEventListener('click', function (e) {
			if (e.target.closest('.chat-facade')) {
				e.preventDefault();
				loadChat(); // then call your chat vendor's "open" function once it is ready
			}
		});
	})();
	</script>
	<?php
}, 100 );

If Hotjar must stay in GTM, put the same timer-and-idle wrapper around its code inside a Custom HTML tag that fires on Window Loaded.

Snippet 5: CSS for less rendering work (DOM sections, product grid, mobile menu)

Where: Appearance > Customize > Additional CSS (or Elementor > Site Settings > Custom CSS). For 5A, add the class cv-auto in Elementor: select the section or container > Advanced > CSS Classes. Check every page type on staging, because this CSS changes how off-screen parts render.

/* 5A) Skip rendering far-below-the-fold sections until they scroll near.
   Use only on full-width sections (reviews, related products, footer).
   Not on sections with dropdowns, sticky parts or tooltips, as they get clipped. */
.cv-auto {
	content-visibility: auto;
	contain-intrinsic-block-size: auto 800px; /* rough section height */
}

/* 5B) Category grid on mobile: skip rendering off-screen product cards */
@media (max-width: 767px) {
	.woocommerce ul.products li.product {
		content-visibility: auto;
		contain-intrinsic-block-size: auto 420px; /* rough card height */
	}
}

/* 5C) Mobile menu: slide with transform (cheap), not height or a JS animation.
   Rename .mobile-menu-panel to your menu's class. */
@media (max-width: 1024px) {
	.mobile-menu-panel {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		width: 85vw;
		max-width: 360px;
		overflow-y: auto;
		z-index: 9999;
		transform: translateX(-100%);
		visibility: hidden; /* keeps hidden links out of keyboard focus */
		transition: transform .25s ease-out, visibility 0s linear .25s;
	}
	.mobile-menu-panel.is-open {
		transform: none;
		visibility: visible;
		transition: transform .25s ease-out;
	}
}

Only if you rebuild the menu with your own toggle button (an Elementor container with class mobile-menu-panel and a button with class mobile-menu-toggle), add this tiny toggle. Where: PHP snippet (Code Snippets, front-end only) or child theme functions.php. If you keep Elementor's Nav Menu widget, skip this and just shrink the menu.

/**
 * Lightweight mobile menu toggle: one class change, the CSS does the animation.
 */
add_action( 'wp_footer', function () {
	?>
	<script>
	document.addEventListener('click', function (e) {
		var toggle = e.target.closest('.mobile-menu-toggle');
		if (!toggle) { return; }
		var panel = document.querySelector('.mobile-menu-panel');
		if (!panel) { return; }
		var open = panel.classList.toggle('is-open');
		toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
	});
	</script>
	<?php
}, 100 );

Snippet 6: DevTools console checks (nothing is installed on your site)

Where: open a product or category page in Chrome with mobile emulation on > DevTools > Console > paste > Enter. This only reads the page and changes nothing.

// 6A) Where do the 3,900 elements live? (nested blocks are also counted in their parents)
console.log('Total elements:', document.getElementsByTagName('*').length);
console.table(
	[...document.querySelectorAll('[data-elementor-type], header, nav, main, aside, footer')]
		.map(function (el) {
			return {
				block: el.tagName.toLowerCase() + (el.id ? '#' + el.id : '') +
					(el.dataset.elementorType ? ' [' + el.dataset.elementorType + ']' : ''),
				elements: el.getElementsByTagName('*').length,
				visible: el.checkVisibility ? el.checkVisibility() : 'n/a'
			};
		})
		.sort(function (a, b) { return b.elements - a.elements; })
);

// 6B) Elementor blocks hidden on this screen size but still in the DOM
var hidden = [...document.querySelectorAll('[class*="elementor-hidden-"]')]
	.filter(function (el) { return el.checkVisibility && !el.checkVisibility(); });
console.log('Hidden Elementor blocks:', hidden.length, '| elements inside them:',
	hidden.reduce(function (n, el) { return n + el.getElementsByTagName('*').length; }, 0));

// 6C) Log cart fragment events, then tap Add to cart. More than one refresh per add = duplicate work.
jQuery(document.body).on('wc_fragment_refresh wc_fragments_refreshed wc_fragments_loaded added_to_cart', function (e) {
	console.log(e.type, Math.round(performance.now()) + ' ms');
});

5. Verify plan

Day 0: baseline

  • Write down the PageSpeed Insights field INP (mobile and desktop) for your origin, one product URL and one category URL, plus the Search Console Core Web Vitals status for product and category URL groups.
  • Add Snippet 1. If you can, collect 7 days of RUM before you change anything. If not, start it on the same day as batch 1.
  • Lab baseline: DevTools, 4x CPU throttle, mobile emulation. Tap Add to cart, a filter checkbox and the menu 5 times each, during load and after load. Write down the median of each of the 3 parts.

Ship in batches, and write down each date

  • Batch 1 (week 1): fixes 1-4 (A/B script, GTM, heavy extras, Add to cart feedback).
  • Batch 2 (week 2): fixes 5-7 (cart fragments, filter, mobile menu).
  • Batch 3 (weeks 3-4): fixes 8-9 (DOM size, plugin audit).
  • After each batch, repeat the lab test. Lab goals (guess, because the lab is harsher than the field): each interaction under 200 ms at 4x throttle, input delay under 50 ms, and no A/B tool task during the tap.
  • After each batch, also check that nothing broke: add to cart for simple and variable products, the header cart count updates, GTM Preview shows the tags firing on cart_updated, GA4 DebugView receives events, Meta Events Manager > Test Events shows AddToCart once (not twice), chat opens, filters return the right products, checkout works, and pages look right on iPhone Safari.

Watch RUM daily for the first 2 weeks

  • p75 INP by page_type and device, plus the top inp_target list.
  • Check that the right part moved:
    • After batch 1, Add to cart input delay should drop the most, and the A/B tool should disappear from inp_top_script.
    • After batch 2, processing time on Add to cart and the filter should drop.
    • After batch 3, presentation delay should drop.
  • If a part didn't move, re-trace that interaction before you go on.

Field data over 28 days

  • CrUX (which feeds PageSpeed Insights and Search Console) uses a rolling 28-day window, so the number falls slowly. Each fix only shows fully 28 days after release. Check at day 7, 14 and 28 after the last batch.
  • When RUM shows a mobile p75 under 200 ms for 7 days in a row, click Validate fix on the INP issue in Search Console. Validation monitors for 28 days.
  • Success means: mobile p75 INP of 200 ms or less in CrUX (origin and product/category groups), desktop staying at 200 ms or less, and an add-to-cart rate and conversion rate that are flat or up.

Keep it fixed

  • Before any new plugin, GTM tag or script goes live, run the lab tap test.
  • Re-test after Elementor, WooCommerce or theme updates.
  • Keep Snippet 1 running and check the RUM report once a month.

The prompt

First lines open so you can see how it is built. The rest opens after purchase.

the prompt · 626 words7 sections
#ROLE
You are a web performance engineer specializing in Interaction to Next Paint (INP). Find what makes my site slow to respond to clicks, taps and typing, and give me a fix plan.

#INPUTS
Fill in every line. Leave a line blank if you don't know it.
- Website: [WEBSITE URL]
- Platform, theme and framework: [e.g., Shopify theme + 15 apps, WordPress + WooCommerce + Elementor, React/Next.js]
- Third-party scripts: [e.g., chat widget, reviews app, tag manager, A/B testing, heatmaps, ads]
Full prompt opens after purchase
Sections inside: #ROLE #INPUTS #FACTS #PROCESS #OUTPUT FORMAT #RULES #QUALITY CHECK

How to use it

  1. Buy, then open it in your account.
  2. Copy the prompt into ChatGPT, Claude or Gemini.
  3. Replace the 6 inputs with your product.
  4. Run it. Use the output. Re-run with a different tone if you like.

Pro tips

  • Find your slowest real interaction first. Fixing the menu won't help if 'Add to cart' is the problem.
  • List every third-party script. Delaying or removing just one or two often fixes INP.
  • Ignore old FID advice. INP is the metric Google uses now.

Before you buy

Will it work for my product?
Yes, if you can fill the 6 inputs. If the output is bad with your inputs, email us: we fix the prompt and refund you.
Do I download a file?
No. It lives in your account with a copy button, and updates when we improve it.
Which model is best?
Best on Claude. Works in ChatGPT, Claude and Gemini.

Works well with this

Prompts people use in the same campaign.

More in Page Speed & Core Web Vitals

See all in this sub-category

Buying more than two? Lifetime is cheaper.

Every prompt, every category, forever. $59 once. Nothing to download, nothing to renew.

Get lifetime · $59

This prompt

$3$7

  • ✓ Instant access in your account, with a copy button
  • ✓ Example input and real output included
  • ✓ 7-day money-back, no form

Or get every prompt, forever

Lifetime Access · $59 $149 — all categories, all future prompts, rewrites included.

Get lifetime access

Card or PayPal · taxes at checkout · nothing to download

Not the one you need?

Browse every prompt by category and sub-category.

Browse all prompts
Lifetime $59 →