Skip to main content

Core Web Vitals Fix Generator (LCP, INP, CLS)

Diagnose and fix Core Web Vitals issues — LCP, INP, and CLS problems with code-level solutions for your specific tech stack.

Füllen Sie die Platzhalter aus

Edit the values, then copy your finished prompt.

Ihr Prompt
prompt.txt

                                

What this prompt does

This prompt diagnoses and fixes Core Web Vitals for a site at [site_url] built with [tech_stack], starting from your current [lcp], [inp], and [cls] scores and driving toward Google's "Good" thresholds. It identifies the [lcp_element] and optimizes it, then works through image formats and responsive loading, font optimization, critical CSS, JavaScript splitting, INP and main-thread work, layout-shift fixes, TTFB tuning for [hosting], and third-party script impact — ending with stack-specific code snippets and a priority order with expected gains per fix.

The structure works because Web Vitals problems are usually a handful of concrete culprits, not a mystery. Naming the [lcp_element] (often a hero image) lets the model target the single biggest LCP win directly. Supplying real [lcp], [inp], and [cls] numbers tells it which metric is worst and worth prioritizing, while [tech_stack] and [hosting] make the code snippets and TTFB advice match your actual environment instead of generic guidance. Each metric maps to a distinct set of fixes — LCP to image and render-path work, INP to main-thread and interaction cost, CLS to layout stability — so the plan reads as three focused tracks rather than one vague "make it faster," and each comes with an expected improvement so you can sequence the work by payoff.

When to use it

  • Search Console flagged a Core Web Vitals regression you need to fix
  • Your LCP is slow and you suspect a large hero or banner image
  • You have visible layout shift from images or ads without set dimensions
  • Interactions feel sluggish and INP is over the 200ms threshold
  • You want stack-specific fixes rather than generic performance tips
  • You need a prioritized list ranked by expected score improvement

Example output

Expect a diagnosis-then-fix report: the identified [lcp_element], a ranked list of issues across LCP, INP, and CLS, and concrete code snippets tailored to [tech_stack] — things like AVIF conversion with priority hints, font-display swap, deferred scripts, and pinned image dimensions. Each fix comes with an expected impact and a priority order, so you can tackle the biggest green-score wins first.

Pro tips

  • Pull your real [lcp], [inp], and [cls] from field data, not a single lab run, so the priorities reflect actual users
  • Name the [lcp_element] accurately; if it is the hero image, AVIF plus priority hints is usually the biggest single win
  • Set [tech_stack] precisely so the snippets use your real framework's loading and bundling APIs
  • Tell it the real [hosting] since TTFB advice for shared hosting differs from a CDN-backed setup
  • The boring fixes win — pinning image dimensions to kill CLS and optimizing the LCP image often beat exotic tweaks
  • Implement in the prompt's priority order and re-measure after each change rather than shipping everything blind

Frequently Asked Questions

Do I need to give it my real Web Vitals scores?
It works best when you do. Supplying real `[lcp]`, `[inp]`, and `[cls]` values lets the prompt prioritize the worst metric and estimate gains. Ideally use field data from Search Console rather than a single lab run, since lab numbers can differ significantly from what real users experience.
Will the code snippets match my framework?
Yes, the snippets are tailored to the `[tech_stack]` you specify, so a Laravel and Blade setup gets different code than a Next.js one. Set the stack accurately, and still review the generated snippets against your project's actual structure before applying them.
What usually gives the biggest LCP improvement?
For most sites it is optimizing the `[lcp_element]`, typically a hero image, by converting to AVIF or WebP and adding priority hints. These are unglamorous fixes but reliably move LCP into the green. The prompt identifies your specific LCP element so the optimization targets the right asset.
Can it fix layout shift from ads and dynamic content?
It addresses CLS by recommending set dimensions on images and ad slots and avoiding dynamic content injection above the fold. Third-party ads are harder to fully control, so the advice reduces shift rather than guaranteeing a perfect zero, especially where the ad network injects unpredictable sizes.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Mehr in SEO & Digital Marketing Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support