Your prompt
Fix layout shift on my site: add width and height to every image, reserve space for embeds and ads, and preload my main web fonts.
What this prompt does
This prompt tackles Cumulative Layout Shift, the visual jumping that happens when content loads and pushes other things around. Your AI assistant is asked to add width and height to every image, reserve space for embeds and ads, and preload your main web fonts.
Giving an image its dimensions lets the browser set aside the right amount of room before the file arrives. The same goes for videos, maps and adverts. Fonts matter because a late font swap can change line lengths and move text.
WordPress adds dimensions to many images automatically, but images from older content, custom code or page builders can still miss them.
Layout shift is easiest to spot on a slow connection, where late elements arrive visibly after the rest. Test with a throttled connection in your browser’s developer tools to see it.
Before you run it
- Take a backup, since the assistant edits content and theme settings.
- Note which embeds and ad slots you use, and how tall they normally are.
- List the exact fonts used on the site, or ask the assistant to find them.
- Check on a phone as well, because shifts are often more visible on narrow screens.
Ask to see what it changes. Reserving the wrong height for an ad can leave a blank gap, so it is worth confirming the sizes.
What to check afterwards
- Load the pages on a throttled connection and watch for jumps.
- Images carry width and height attributes in the page source.
- Embeds and ad slots occupy their space before they load.
- Fonts load without a noticeable change in text size or position.
- A re-test with PageSpeed Insights shows a lower CLS value.
Ways to adapt it
- Aim at one part: Only fix the images on my blog posts and leave the layout alone.
- Add a banner: Also reserve space for my cookie banner so it does not push content.
- Font change: Host the fonts on my own server rather than loading them from a third party.
If it goes wrong
- A blank gap appears. The reserved space is too large, so reduce the height.
- Shifts remain. Late-loading elements such as popups or banners may be the cause, so ask the assistant to find them.
- Images look stretched. Dimensions must keep the original proportions.
For a deeper look at fonts, see self-hosting fonts and Core Web Vitals.