How-To Guide · November 1, 2026
How to Prompt AI to Fix a Slow Website (and Raise Your PageSpeed Score)
How to prompt AI to fix a slow website: measure with PageSpeed Insights, have the AI plan before it codes, fix one issue per prompt, and know when rendering is the real problem.

TL;DR
- To prompt AI to fix a slow website, run Google PageSpeed Insights first, paste the exact failing metrics into the AI, and ask it to plan the fixes before changing any code.
- Fix in order of impact: oversized images, the main (hero) image, unused scripts and CSS, then layout shift.
- Give one fix per prompt, tell the AI not to change the design, and re-test after every change.
- If a multi-page AI site stays stuck in the 30s or 40s on mobile, the problem is usually how the pages are rendered, not your prompts.
Most AI-built sites look great and load slowly. Asking the AI to "make it faster" rarely works, and on Reddit people describe the AI going in circles when they try. Here's the order that actually works.
Step 1: Measure before you prompt
Run the live URL through PageSpeed Insights on mobile and write down the Performance score, LCP (how long the main content takes to show), CLS (how much the layout jumps), and the top items under "Opportunities" and "Diagnostics". Those items become your prompt. Locasly shows a PSI score on each prospect's site, so you can spot slow sites before you even pitch.

Step 2: Ask the AI to plan, not fix
Get a ranked list of problems before any code changes. This stops the "fix one thing, break three" loop.
My site scores [SCORE] on mobile PageSpeed. LCP is [X]s, CLS is [Y].
PageSpeed flags: [paste the top 3-5 Opportunities/Diagnostics].
Analyze the project and list the causes, ordered by expected impact.
Do not change any code yet. Do not change the design or content.
Step 3: Fix one thing per prompt
Work down the list, and re-run PageSpeed after each change. The usual order:
- Images. Convert to WebP, resize to the size they're actually displayed at, and add width and height to every image.
- The hero image. Make sure the top image is not lazy-loaded. Lazy-loading the main above-the-fold image is a common AI mistake that hurts LCP.
- Scripts and CSS. Remove unused libraries, fonts, and animations; defer anything not needed for the first screen.
- Layout shift. Reserve space for images, embeds, and fonts so the page doesn't jump.
Fix only item 1 from your list: compress and resize all images to WebP,
add explicit width and height to every img, and lazy-load images below
the fold only. Keep the hero image eager with fetchpriority="high".
Do not change layout, colors, or text. Summarize what you changed.
If a fix makes things worse, revert it instead of stacking more prompts on top. For more on safe edit prompts, see how to edit an AI-generated website with follow-up prompts.
Step 4: Know when it's not a prompt problem
Many AI builders output single-page apps that load the whole site's JavaScript before showing anything. A small one-page site usually scores fine; a big multi-page site often won't, no matter how you prompt. The fix there is pre-rendering or server-side rendering (sending finished HTML), which may mean changing hosting or the setup, not writing a better prompt.
What Reddit users reported
- One r/lovable user said their one-page sites scored 80+, but a multi-page site with a large catalog stayed stuck at 35–40 for performance, and the AI looped when asked to fix it (thread).
- Another r/lovable user who rebuilt their computer repair shop site reported mobile PageSpeed going from 57 to 96 and desktop from 79 to 99, with server-side rendering as a big part of it. They said speed alone didn't drive their traffic gains (thread).
- One commenter said a static-generation change moved their score from 86 to 88, but mobile dropped to 66, a good reminder to re-test mobile after every change (thread).
These are individual reports, not guaranteed results.
FAQ
Why is my AI-generated website so slow?
Usually oversized images, too many scripts and animations, and client-side rendering that makes the browser build the page from JavaScript.
What PageSpeed score is good enough for a local business?
Aim for 90+ on mobile if you can, but focus on LCP under 2.5 seconds and low layout shift; a fast-feeling page matters more than a perfect number.
Can ChatGPT fix my PageSpeed score?
It can fix images, scripts, and layout shift if you paste the exact PageSpeed findings and ask for one change at a time. It can't change how your builder renders pages.
Should I pitch slow sites to local businesses?
Yes, a low score is a concrete, neutral talking point. See how to audit a local business website before pitching.
Steps at a glance
- Measure before you prompt
Run PageSpeed Insights on mobile and note the score, LCP, CLS, and top Opportunities.
- Ask the AI to plan, not fix
Paste the findings and ask for a ranked list of causes without changing code or design.
- Fix one thing per prompt
Fix images, the hero image, unused scripts and CSS, then layout shift, re-testing after each change.
- Know when it is not a prompt problem
If a multi-page AI site stays slow, look at pre-rendering or server-side rendering.