LCPCore Web VitalsAITutorial

How to Fix Your LCP Score Using AI in 10 Minutes

A step-by-step tutorial showing how to export your Lighthouse JSON report and use ChatGPT, Claude, or Cursor to get exact code-level fixes for a poor Largest Contentful Paint score.

PageSpeed Exporter··6 min read

Largest Contentful Paint (LCP) is the single most impactful Core Web Vitals metric for both user experience and Google search rankings. A good LCP score is under 2.5 seconds. A poor score — anything over 4 seconds — directly hurts your organic traffic.

The problem with most performance tools is they tell you what is slow, but not exactly how to fix it. That gap is where AI agents excel — but only if you give them the right data.

This tutorial shows you the exact workflow to go from a poor LCP score to a concrete fix plan in under 10 minutes.


What You Need

  • Any website URL (yours, a client's, or one you're investigating)
  • A free PageSpeed Exporter account (or use the 2 anonymous previews)
  • Access to ChatGPT, Claude, Cursor, or any AI coding agent

Step 1: Run the Audit

Go to speedexporter.com and enter your URL. Select Mobile for the strategy — Google primarily uses mobile-first indexing, so your mobile LCP score is what matters most for search rankings.

Click Analyze. The audit typically takes 15–30 seconds.


Step 2: Review the LCP Score

Once the report loads, look at the Largest Contentful Paint metric card. The color coding tells you where you stand:

  • Green (0–2.5s): Good — no urgent action needed
  • Orange (2.5s–4s): Needs Improvement — worth fixing
  • Red (4s+): Poor — this is actively hurting your rankings and conversions

Also check the Opportunities and Diagnostics sections. The issues most likely affecting your LCP score will be:

  • largest-contentful-paint-element — identifies the exact element causing the slow LCP
  • render-blocking-resources — CSS or scripts blocking paint
  • unused-css-rules and unused-javascript — bytes loaded but not used
  • uses-optimized-images and uses-webp-images — uncompressed or wrong-format images
  • server-response-time — slow TTFB which delays everything downstream

Step 3: Download the JSON Report

Click Download JSON on the results page. This gives you the full AI-ready report — every audit, metric, opportunity, and diagnostic in structured JSON format.

The downloaded file contains your LCP element, the estimated savings for each fix in milliseconds, the performance weight of each audit, and CrUX real-user data showing how real visitors experience your site.


Step 4: Feed It to Your AI Agent

Open ChatGPT, Claude, or Cursor. Upload or paste the JSON file, then use this prompt:

I'm attaching my full Lighthouse JSON performance report for [your-site.com].

My LCP score is [X seconds] — I need to get it under 2.5 seconds.

Please do the following:
1. Identify the LCP element and explain exactly why it is rendering slowly
2. List every audit that is directly contributing to the slow LCP, sorted by estimated time savings (ms)
3. For each issue, provide the exact code change, config update, or asset optimization needed to fix it
4. Give me a realistic estimate of how much each fix will improve my LCP score
5. Tell me which fix I should implement first for the fastest improvement

I'm using [Next.js / WordPress / Shopify / plain HTML — fill in yours].

Replace [your-site.com], [X seconds], and the framework placeholder with your actual values.


Step 5: Implement the Fixes

Your AI agent will now produce a prioritized action plan. Common LCP fixes and what they look like in code:

Preload the LCP image:
<link rel="preload" as="image" href="/hero-image.webp" fetchpriority="high">
Convert to WebP and add proper sizing:
<img
  src="/hero.webp"
  width="1200"
  height="630"
  alt="Hero image"
  loading="eager"
  fetchpriority="high"
/>
Remove render-blocking CSS (inline critical CSS):
<style>
  /* Paste critical CSS here — only what's needed for above-the-fold content */
  body { margin: 0; font-family: sans-serif; }
  .hero { ... }
</style>
<link rel="preload" href="/styles.css" as="style" onload="this.rel='stylesheet'">
Improve server response time (TTFB) — add Cache-Control headers:
Cache-Control: public, max-age=31536000, immutable

Step 6: Re-Scan and Compare

After implementing fixes, run another audit in PageSpeed Exporter. If you're on the Starter or Pro plan, you'll see a before/after comparison automatically — showing the delta in LCP, performance score, and each individual audit.

Repeat the cycle: export → AI agent → fix → re-scan.


Why This Approach Works Better Than Generic Advice

Most blog posts about LCP give you generic advice: "optimize your images," "reduce render-blocking resources." That advice is accurate but not actionable — it doesn't tell you which image, which resource, or what the code should actually look like on your specific site.

When you feed a complete Lighthouse JSON report to an AI agent, it knows:

  • The exact LCP element (e.g., )
  • The estimated savings for each fix in milliseconds
  • Your tech stack (detected via StackPacks — WordPress, Next.js, React, etc.)
  • Your real-user field data (CrUX), showing whether the lab data matches what real visitors experience

That specificity is what produces fixes that actually work, not boilerplate advice.


Common LCP Pitfalls

Lazy-loading the LCP element. Never add loading="lazy" to the image that is your LCP element. The LCP element should load as fast as possible — lazy loading actively delays it. Not preloading the LCP image. If your LCP element is an image, add a tag in the so the browser discovers it as early as possible. A slow server response time. No amount of image optimization will fix an LCP of 6 seconds if your TTFB is 3 seconds. Check the server-response-time audit first — if TTFB is over 600ms, that's the root cause. Fonts blocking render. Web fonts that block text rendering can contribute to LCP if text is your LCP element. Use font-display: swap and preload critical fonts.

Ready to Try It?

Run a free Lighthouse audit on any URL at speedexporter.com — no account required for the first two reports. Get the full JSON and drop it into your AI agent of choice.

If your LCP is poor, you could have a concrete fix plan in your hands in under 10 minutes.


Try it yourself

Run a free Lighthouse audit on any URL and get the full JSON report for your AI agent — no account required.

Analyze a URL for free