Improve a website’s Core Web Vitals (LCP, INP and CLS)
Interpret your PageSpeed Insights or Lighthouse report and get the likely causes of poor LCP, INP or CLS, prioritized fixes with code and a plan to measure with real-user data. Designed for ChatGPT, Claude, Gemini and Microsoft Copilot. It includes 4 customizable variables and you can copy it for free in one click.
Advanced · Code · Pending editorial review
Prompt
Act as a web performance specialist who optimizes Core Web Vitals using both field and lab data.
Context:
- Page and type: {{page}}
- Report data: {{report}}
- Tech stack: {{stack}}
- Data available: {{data_type}}
If the report does not show the LCP element, which interactions are slow or which elements shift, explain how to find out and ask me before recommending changes.
Deliverables:
1. Report reading: status of each metric against the "good" thresholds (LCP up to 2.5 s, INP up to 200 ms, CLS up to 0.1, at the 75th percentile) and the gap between field and lab data.
2. LCP: identify the element and break it down into time to first byte, resource load delay, load duration and render delay, with the most likely cause of each part.
3. INP: long tasks and scripts involved, and techniques to reduce it (break up tasks and yield to the main thread, defer third-party scripts, do less work in event handlers, avoid expensive re-renders).
4. CLS: elements that shift and how to reserve space (image and iframe dimensions, aspect-ratio, fallback fonts with adjusted metrics, injected content).
5. A table of fixes prioritized by estimated impact and effort, with code snippets adapted to {{stack}} (fetchpriority, preload, image formats, font-display, lazy loading, etc.).
6. A measurement plan: how to collect real metrics with the web-vitals library or real-user monitoring, and how long to wait to see the effect in field data.
7. What not to do, such as lazy-loading the LCP image or hiding content to game the score.
Constraints:
- Do not promise a specific score or Google rankings; improvements are estimated, not guaranteed.
- Do not invent values: if data is missing, mark it [FILL IN].
- When field data and the Lighthouse score disagree, prioritize field data.
Output format: a five-line executive summary, one section per metric, the prioritized table and the measurement plan.How to use it
- Run PageSpeed Insights on the URL and copy the field and lab values plus the opportunities it lists. 2. State the stack and page type. 3. Apply the highest-impact fixes first and measure again before moving on.
Usage example
Page: product page on an online store · Report: LCP 4.1 s, INP 320 ms, CLS 0.22 on mobile (field data) · Stack: WordPress with WooCommerce · Data: field and lab.
Sample output
Summary
| Metric (p75, mobile) | Value | "Good" threshold | Status |
|---|---|---|---|
| LCP | 4.1 s | ≤ 2.5 s | Poor |
| INP | 320 ms | ≤ 200 ms | Needs improvement |
| CLS | 0.22 | ≤ 0.1 | Needs improvement |
The 900 KB hero image is almost certainly the LCP element; the 1.2 s of blocking time from third-party scripts explains much of the INP.
Priority 1: LCP image and third-party scripts (child theme functions.php)
add_filter('wp_get_attachment_image_attributes', function ($attr, $attachment, $size) {
if (is_product() && $size === 'woocommerce_single') {
$attr['fetchpriority'] = 'high';
$attr['loading'] = 'eager'; // never lazy-load the LCP image
}
return $attr;
}, 10, 3);
add_filter('script_loader_tag', function ($tag, $handle) {
$defer = ['chat-widget', 'reviews-widget']; // [FILL IN: real handles]
return in_array($handle, $defer, true) ? str_replace(' src=', ' defer src=', $tag) : $tag;
}, 10, 2);
Also serve the image as WebP or AVIF with a srcset matching its real mobile width. Expected gain: [FILL IN after measuring]; field data takes a few weeks to reflect it…
Key facts
- Category
- Programming & development · Build websites
- Output type
- Code
- Level
- Advanced
- Designed for
- ChatGPT, Claude, Gemini and Microsoft Copilot
- Verified in
- Pending editorial verification
- Variables
- Page and type, Report data, Tech stack and Data available
- Language
- English
- Price
- Free, no sign-up
- Updated
- Nov 7, 2026
Frequently asked questions
Why does my Lighthouse score not match field data?
Lighthouse simulates one load on a specific device and network, while field data reflects real visits over weeks. Google uses field data to assess Core Web Vitals.
What is INP?
Interaction to Next Paint measures how long the page takes to respond visually to clicks, taps or key presses throughout the whole visit. It replaced FID as the responsiveness metric in 2024.
How long until improvements show up?
In lab tests, immediately. In Chrome field data, which is aggregated over a 28-day window, the improvement shows up gradually over several weeks.
What is this prompt for?
Interpret your PageSpeed Insights or Lighthouse report and get the likely causes of poor LCP, INP or CLS, prioritized fixes with code and a plan to measure with real-user data.
Which AI tools does it work with?
It is designed for ChatGPT, Claude, Gemini and Microsoft Copilot. We have not verified it in these tools yet, so results may vary between them.
How do I customize the prompt?
Click “Customize” and fill in the variables (Page and type, Report data, Tech stack and Data available). The text updates instantly and you can then copy it in one click. Values are stored only in your browser.
Do I need experience to use it?
It is advanced: it is meant for people with experience in the topic who can evaluate and adjust the result.
Is this prompt free?
Yes. Every HomeCasa Prompts prompt is free, with no sign-up or subscription. You can also use them in professional projects.
Can I trust the AI output?
Treat it as a high-quality draft: always check data, figures and important claims before publishing or making decisions.