Quick answer
Measure first, then fix the biggest cause first. Run your page through Google’s free PageSpeed Insights, read the mobile result, and work down its Insights list in the order it gives. The usual suspects are oversized images, then scripts and embeds you no longer use, then heavy fonts — but the order on your page is whatever your report shows. None of these needs a rebuild.
This guide is for a finished site that loads but feels slow, especially on a phone. If a page does not load at all, or shows a blank page, use the blank page guide or the 404 guide instead.
Before you start
You need the exact URL of your slowest important page — usually the homepage — and a desktop browser. Nothing to install and nothing to pay: the measurement tool is free.
Keep a saved copy of the site before changing anything. Change one thing at a time, and re-measure after each change, so you can tell which fix actually helped.
Your route: Measure the page → Shrink the images → Remove or delay unused scripts → Lighten the fonts → Re-measure.
1. Measure the page before changing anything
Open PageSpeed Insights and enter your page URL. It gives separate reports for mobile and desktop. Read the mobile report first: Google indexes the web mobile-first, and a phone on a mobile connection exposes problems a fast desktop hides.
Write down three numbers from the top of the report:
- LCP (Largest Contentful Paint): how long until the main content — usually a hero image or headline — is visible. Google’s target is 2.5 seconds or less.
- INP (Interaction to Next Paint): how quickly the page responds when a visitor taps or clicks. Google’s target is 200 milliseconds or less.
- CLS (Cumulative Layout Shift): how much the page jumps around while loading. Google’s target is 0.1 or less.
These three are the Core Web Vitals. When the report shows them at the top, they are real-user (field) measurements collected over the previous 28 days. The 0–100 score underneath them is a lab result from a single test run — useful for finding problems, but not itself a ranking signal. It is the lab section, not the 28-day field numbers, that changes when you re-test after a fix.
Also note the “Insights” list below the score (called “Opportunities” in older reports): it ranks the problems by estimated time saved, biggest first. That order is your work plan — do not start with a small item while a big one sits at the top.
New or low-traffic sites may have no field data — the real-user section may be empty. That is normal: the lab result still shows you what to fix, and field data appears once enough real visitors have loaded the page. INP is the field number most often missing, because it can only be measured from real taps and clicks. If INP has no data while the other two do, use the lab section’s Total Blocking Time as your stand-in for responsiveness, and check INP again after the page has had more real visits.
2. Shrink the images — usually the biggest win
Images are often the largest files on a page, and AI builders commonly ship photos straight from a phone or a stock library at full size. A 4,000-pixel photo displayed in a 400-pixel card still costs the visitor the full download.
Go through the images on the page, biggest file first, and ask your AI coding assistant to do three things for each one:
- Resize to the size it is displayed at. An image shown at 800 pixels wide does not need to be 3,000 pixels wide. The assistant can read the display size from the page and resize the file to match, keeping a little extra for sharp screens.
- Convert to a modern format. Convert photos to WebP: Google reports lossy WebP is 25 to 34 percent smaller than JPEG at the same quality. Keep the original file until you have checked the new one looks right.
- Compress. A free browser tool such as Squoosh opens an image, lets you compare the result side by side, and saves the smaller file. Your images are processed locally in your browser — they are not uploaded to a server.
Then handle loading order. Add loading="lazy" to images below the fold, so the browser does not download them until the visitor scrolls near them. But do not lazy-load the main image at the top of the page: that image is usually the LCP element, and delaying it makes the key metric slower. Give the top image fetchpriority="high" instead, so the browser starts it first.
Finally, make sure every image has explicit width and height attributes. Without them the browser does not know how much space to reserve, and the page jumps when the image arrives — that jump is the CLS number from step 1.
After the image pass, check the page visually at desktop, 390px and 320px widths. Images should look the same as before, just smaller in file size. If one looks blurry, the resize went too far: restore the original and try a gentler size.
3. Remove or delay scripts and embeds you do not use
Every chat widget, analytics script, social embed and video player on a page costs loading time, and AI builders often include several that the owner never uses. PageSpeed Insights lists them in its Insights, usually as “Reduce unused JavaScript” or by naming the third-party script.
List what the page actually loads. In your browser’s developer tools, open the Network panel, reload the page, and sort by size. Or ask your AI coding assistant to list the scripts and embeds in the project and say which ones the visible page needs.
For each item, decide:
- Remove it if nothing on the page uses it — a chat widget nobody answers, an analytics tool you never open, a social feed that no longer displays. Removing is better than delaying.
- Delay it if it is useful but not needed immediately — for example, load a video player only when the visitor scrolls to it, or load a chat widget after the main content appears. Ask the assistant to defer it rather than removing it.
- Keep it if the page breaks without it. Do not remove a script just because the report names it; check what it does first.
Do not accept a fix that hides the symptom by removing something visitors rely on, such as the contact form’s script. The goal is a page that loads faster and still works.
4. Lighten the fonts
Fonts are a smaller cause than images, but they are a common one on AI-built sites, which often load several font families in many weights. Each weight is usually a separate file the visitor downloads before text can display properly — the exception is a variable font, where a single file covers a range of weights.
Ask your assistant how many font families and weights the site loads, and whether the page uses them all. Then:
- Keep one font family for headings and one for body text, and drop the rest.
- Keep only the weights the page actually uses — usually regular and bold. A thin, light and black weight that appears nowhere is pure download cost.
- Where the design allows, use a system font stack for body text: the visitor’s device already has those fonts, so nothing is downloaded at all.
After the change, check the page again. The text should look the same to a casual reader; if a heading now looks wrong, one of the removed weights was in use, and the assistant should restore that one only.
5. Worked example: a portfolio page repaired in the report’s order
Prepared example, not a recorded site test. A fictional photographer’s portfolio homepage scores poorly on mobile in PageSpeed Insights. These are the supplied observations:
- LCP is 4.1 seconds; the largest element is a hero photo, 3.8 MB, 4,000 pixels wide, displayed at 800 pixels.
- Eight gallery photos below the fold load immediately, at full size.
- An unused chat widget and an old analytics script add two more requests.
- Three font families load in six weights; the page visibly uses two families in two weights.
The repair, in the report’s order, is:
- Resize the hero photo to its display size and convert it to WebP, keeping
fetchpriority="high"and no lazy loading on it. - Resize and convert the gallery photos, and add
loading="lazy"to them. - Remove the chat widget and the unused analytics script.
- Drop the unused font family and the four unused weights.
The expected outcome is an LCP under Google’s 2.5-second target and a shorter Insights list on the next run. This is an expected outcome to verify, not a measured result: the example was prepared for this tutorial, and real sites vary. Re-measure your own page after each step, and keep the fix that moved your own numbers.
6. Re-measure and keep a note
After publishing the fixes, run PageSpeed Insights on the same URL again and compare the lab results with the lab numbers from your first run. A fix that moved the lab numbers helped; a fix that did not can be reverted. Do not expect the top-of-report field numbers to move the same day: they are a rolling 28-day window of real visits, so judge them again after a few weeks of traffic.
Keep a short note: the date, the three numbers before and after, and what changed. The next time the site feels slow, that note tells you what already worked.
If the numbers barely move after the image, script and font passes, look at the time to first byte (TTFB) — how long until the server sends the first piece of the page. A slow TTFB is a problem in the path a request travels before your page itself starts arriving — DNS lookup, connection and TLS setup, redirects, or the server’s own processing — not a problem in the page’s images and scripts, and no amount of image shrinking will fix it. Nor is it automatically your host’s fault: work through those stages first; the hosting guide covers the hosting side of that check.
Sources and limits
Official sources checked November 19, 2026: About PageSpeed Insights (lab and field data, and the 28-day field window); web.dev: Web Vitals (the Core Web Vitals thresholds used above: LCP 2.5 seconds or less, INP 200 milliseconds or less, CLS 0.1 or less); web.dev: Time to First Byte (what TTFB measures and its common causes); Google’s WebP compression study (the 25–34 percent size saving); and Squoosh for browser-based image compression, which processes images locally.
The portfolio example, measurements and repair list were prepared for this tutorial. No live site, customer incident or measured improvement is claimed. This article helps you find and fix the usual causes of a slow AI-built page; it does not guarantee a score or a ranking.
Questions & answers
Will a higher PageSpeed score improve my Google ranking?
Not directly. Google does not use the 0–100 lab score itself as a ranking signal; it uses the real-user Core Web Vitals readings (LCP, INP and CLS) shown at the top of the report. Use the score to find problems, and judge success by those three readings.
Do I need to rebuild my website to make it faster?
Usually not. Slow AI-built sites are usually slow because of oversized images, unused scripts or heavy fonts — all fixable in the existing site. Only a slow server response (a long time to first byte) points away from the page itself — and even then the cause may be DNS, connection setup, redirects or server processing rather than the host.
Should I lazy-load every image?
No. Lazy-load images below the fold only. The main image at the top of the page — usually the largest contentful paint element — should load immediately, or you will make the key metric slower, not faster.