Fix INP: making your site respond instantly

A practical guide to fix INP (Interaction to Next Paint) on any website, from finding the slow clicks to breaking up long JavaScript tasks, with code examples.

To fix INP, you find the interactions that feel slow, work out which part of the delay is the problem, and then reduce the JavaScript that runs on the main thread around those clicks and taps. In most sites I work on, the cause is one of three things: heavy third-party scripts, a big event handler doing too much at once, or a page so large that every update takes a long time to draw.

INP stands for Interaction to Next Paint. It measures the time from when a visitor clicks, taps or presses a key until the browser shows the next frame on screen. Google treats an INP of 200 milliseconds or less as good, and over 500 milliseconds as poor. It replaced First Input Delay as a Core Web Vital in March 2024.

This guide is for site owners and developers who have seen a "Needs improvement" or "Poor" INP in Search Console or PageSpeed Insights and want to know what to actually change.

What INP measures, in plain terms

When you tap a button, the browser has to do three things before you see anything change:

  1. Input delay. Wait until the main thread is free. If a script is already running, your tap sits in a queue.
  2. Processing time. Run the event handlers attached to that button.
  3. Presentation delay. Recalculate styles, lay out the page and paint the new frame.

INP adds those up for the interactions during a visit and reports a value close to the worst one. So a page can feel fine for most clicks and still fail because the mobile menu or the "Add to cart" button is slow.

Only clicks, taps and key presses count. Scrolling and hovering do not. That is useful to know, because it tells you where to look: buttons, menus, accordions, filters, form fields and anything with an event listener.

If you want the wider picture of how INP sits next to LCP and CLS, start with Core Web Vitals explained for business owners.

Step 1: Find the slow interactions

Do not guess. Start with field data, which comes from real Chrome users.

  • Search Console, Core Web Vitals report. Shows which groups of URLs fail INP on mobile and desktop.
  • PageSpeed Insights. The top section ("Discover what your real users are experiencing") shows INP for the URL or origin if there is enough data. The Lighthouse lab test below it cannot measure INP, because no one is clicking. It shows Total Blocking Time instead, which is a decent hint.

Then reproduce it yourself. Open Chrome DevTools, go to the Performance panel, and look at the live metrics view. It shows your INP as you interact with the page. Turn on CPU throttling (4x or 6x slowdown) to get closer to a mid-range phone. Click every interactive element on the page and watch which one jumps.

For real-user detail, the web-vitals JavaScript library can report which element caused the worst interaction:

import { onINP } from 'web-vitals/attribution';

onINP(({ value, attribution }) => {
  console.log('INP', Math.round(value), 'ms');
  console.log('Element', attribution.interactionTarget);
  console.log('Input delay', attribution.inputDelay);
  console.log('Processing', attribution.processingDuration);
  console.log('Presentation', attribution.presentationDelay);
});

Send those values to your analytics instead of the console and within a few days you will know exactly which button on which page is the problem.

Step 2: Work out which phase is slow

The three phases need different fixes, so this step saves a lot of wasted effort.

Slow phaseWhat it usually meansTypical fix
Input delaySomething else was running when the user tappedReduce or defer other scripts, break up long tasks
Processing timeYour own event handler does too muchDo less, split the work, yield to the browser
Presentation delayThe page is huge or the update touches too much of itSmaller DOM, simpler CSS, content-visibility

In the DevTools Performance recording, click the interaction and you will see these phases labelled. Any single task over 50 milliseconds is called a long task, and long tasks are the root of most INP problems.

Step 3: Cut and delay third-party scripts

On business sites, the biggest cause of input delay I see is scripts the owner did not write: chat widgets, heatmaps, several analytics tags, cookie banners, review widgets and ad pixels. Each one runs code on the main thread, often on a timer. When a visitor taps the menu during one of those runs, they wait.

What I do, in order:

  • List every third-party script on the page. Remove any nobody uses.
  • Load the rest with defer or after the page has become interactive.
  • Load chat widgets only when someone clicks a "Chat with us" button, using a lightweight placeholder until then.
  • Move tags into one tag manager container and remove duplicates. I often find the same analytics loaded twice.

This alone fixes INP on a surprising number of sites, and it helps LCP at the same time, which I cover in how to fix LCP issues.

Step 4: Break up long tasks in your own code

If your own event handler is slow, the fix is to show the visual feedback first and do the heavy work afterwards. The browser cannot paint until your handler gives control back.

A common pattern looks like this:

button.addEventListener('click', async () => {
  // 1. Give instant visual feedback
  button.classList.add('is-loading');

  // 2. Let the browser paint that change
  await yieldToMain();

  // 3. Then do the expensive work
  applyFilters();
  updateResultsCount();
  sendAnalyticsEvent();
});

function yieldToMain() {
  if ('scheduler' in window && 'yield' in scheduler) {
    return scheduler.yield();
  }
  return new Promise((resolve) => setTimeout(resolve, 0));
}

scheduler.yield() is supported in Chromium browsers. The setTimeout fallback works everywhere. The point is the same: split one long task into smaller ones so the browser can paint between them.

Other quick wins inside handlers:

  • Avoid reading layout values (like offsetHeight) right after changing styles. It forces the browser to recalculate layout immediately.
  • Debounce input handlers on search boxes so you are not filtering on every key press.
  • Move analytics calls out of the critical path. Nobody needs the tracking event to finish before the menu opens.

Step 5: Make the page cheaper to update

Presentation delay grows with page size. A page with thousands of DOM elements takes longer to restyle and repaint, whatever your JavaScript does. Page builders are the usual suspect: I have seen Elementor pages with many levels of nested containers for a simple two-column layout.

Things that help:

  • Flatten nested sections and containers.
  • Paginate or lazy-render long lists instead of showing 500 products at once.
  • Use content-visibility: auto on long below-the-fold sections so the browser skips rendering them until needed.
  • Animate with transform and opacity, which avoid layout work, rather than top, height or width.
.long-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

The contain-intrinsic-size value gives the browser a placeholder height so the scrollbar does not jump.

Platform-specific notes

WordPress and Elementor. Turn off plugin features you do not use, especially sliders, popups and animation libraries. Use your caching or optimisation plugin's "delay JavaScript until interaction" option carefully, and test the menu and forms afterwards, because delayed scripts can make the first click slower. The Elementor speed fixes list covers the builder side.

Shopify. Apps inject scripts into every page. Check each app's impact by disabling it on a duplicate theme and measuring again.

React and Next.js. Large hydration work can block early clicks. Keep client components small, keep most of the page as server components or static HTML, and use startTransition for non-urgent state updates such as filtering a list.

How to confirm the fix worked

Lab checks give you quick feedback: re-record in DevTools with CPU throttling and compare. But Search Console uses field data over a rolling 28-day window, so the report will not turn green the day you deploy. When you are confident, use "Validate fix" in the Core Web Vitals report and give it a few weeks.

Keep the web-vitals reporting in place after the fix. New plugins, apps and tags get added over time, and INP is usually the first metric to slip.

What to do next

Start with field data to find which pages fail, then reproduce with DevTools and CPU throttling to find the slow interaction. Check which phase is slow. Remove or defer third-party scripts, split long event handlers so the visual change paints first, and simplify heavy pages. Then measure again and wait for the field data to catch up.

If your site is failing INP and you would rather have someone trace it for you, that is a regular part of my speed optimization service. Send me the URL and I will tell you what is blocking the main thread.

Available for new projects

Need a hand with this?

Tell me what you need: a new site, a fix, a SaaS or an app. You'll get a clear plan and price within a day.

Start a project WhatsApp me