Image SEO optimization means making your images easy for Google to find and understand, and light enough that they do not slow the page. In practice that is five jobs: useful alt text, descriptive file names, the right format and size, correct loading behavior and good page context. This guide gives ten steps for WordPress, checked against Google and web.dev documentation.

Quick answer: Image SEO optimization has five jobs. Write short, accurate alt text. Use descriptive file names. Serve right-sized WebP or JPEG files. Lazy-load only below-the-fold images, never the main hero image. Put each image near relevant text in a normal HTML img tag. Add an image sitemap if Google may miss your images.
Key takeaways
- Google calls alt text the most important metadata attribute for an image. Write it for people first and do not stuff keywords.
- Use short descriptive file names such as
blue-running-shoes.jpg, notIMG00023.JPG. - Google supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. WebP is a safe default for photos on most sites.
- Never lazy-load your LCP image, usually the hero or top image. Lazy-load the rest.
- Set width and height on every image so the page does not jump while loading.
- Use HTML img tags. Google says it does not index CSS images.
- Image SEO optimization helps visibility in Google Images and page speed. It does not guarantee rankings.
In this guide
What is image SEO optimization, and why does it matter?
Image SEO is the practice of preparing images so search engines can discover, understand and show them, while keeping page speed healthy. Images can appear in Google Images and alongside regular results, so a well-prepared image is another way for people to reach your page.
There are two sides to the work: discovery and meaning (alt text, file names, page context, sitemaps) and performance (size, format, loading order). Mistakes on the second side can hurt your Largest Contentful Paint (LCP), the Core Web Vital that measures how fast the main content appears. A good LCP is 2.5 seconds or less at the 75th percentile, per web.dev.
Many guides mix documented advice with folklore. This one sticks to what Google and web.dev document.
How do you write image alt text for image SEO optimization?
Alt text is the text version of an image. Google’s image best practices call it “the most important metadata attribute” for an image and say it improves accessibility for people who cannot see images. Google also says to write useful, context-relevant descriptions and avoid keyword stuffing, which can look like spam.
Follow these image alt text rules for image SEO optimization:
- Describe what the image shows, in context. Ask what a person using a screen reader would need to understand the page.
- Keep it short and specific. “Woman testing a running shoe on a treadmill” beats “shoes running best shoes buy shoes online.”
- Use your keyword only where it fits. If the image really shows your topic, naturally describing it may include the keyword. If not, leave it out.
- Do not start with “image of” or “picture of.” Screen readers already announce an image.
- Leave alt empty on purely decorative images. Use
alt=""for dividers and background-style graphics so assistive tools skip them. - Write unique alt text per image. Do not paste one phrase on every image.
Here is a before-and-after:
- Weak:
alt="seo image seo optimization tips" - Better:
alt="Table comparing JPEG, WebP and AVIF file sizes for a product photo"
For charts, describe the main point in the alt and put details in nearby text.
What are the best image file names for image SEO optimization?
Google’s guidance on image file names is simple: use short, descriptive names. Its example is that my-new-black-kitten.jpg is better than IMG00023.JPG. It also advises avoiding generic names such as image1.jpg or 1.jpg. If you localize images, translate the file names too and URL-encode non-Latin characters.
Practical rules for image file names:
- Use lowercase words separated by hyphens.
- Name the subject, not the camera.
kitchen-remodel-after.jpgbeatsDSC4536.jpg. - Keep it short. Four or five words is plenty.
- Match the extension to the actual file type. A PNG saved as
.jpgis a bug waiting to happen. - Keep the same file URL for the same image across pages. Google recommends consistent URLs so it can understand the image.
Rename before you upload, because changing a name later changes the URL and can break links.
Which image format is best: WebP, AVIF, JPEG or PNG?
Google lists support for BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. So “which format” is mostly a speed and quality question, not a ranking one. Use this table as a default.
| Format | Best for | Notes |
|---|---|---|
| JPEG | Photos, when you need maximum compatibility | Widely supported. Easy to compress |
| WebP | Photos and graphics on most sites | A good default. Supported by WordPress since version 5.8 |
| AVIF | Photos where you want the smallest files | Supported by WordPress from 6.5 if your host supports it. Keep a fallback |
| PNG | Images that need transparency or sharp edges | Files can be large. Avoid for large photos |
| SVG | Logos, icons, simple illustrations | Scales without losing quality. Inline SVGs need a title element for the accessible name |
| GIF | Very short simple animations | Large files. Consider a video instead |
On WebP images versus AVIF, the honest answer is this: both are valid, and both beat large PNGs for photos. We suggest WebP as the default because support is wide and tooling is mature. Try AVIF where file size matters most and your host supports it.
WordPress added WebP upload support in version 5.8. WordPress does not convert your existing JPEG and PNG files on its own, so you need to export WebP yourself or use a plugin or image CDN. From version 6.5, WordPress can handle AVIF uploads, “as long as your hosting environment supports AVIF,” per the WordPress core team. To check your server, go to Tools, then Site Health, then Info, and expand Media Handling.

How big should images be? Resize before you upload
File size is the biggest lever for speed in image SEO optimization. Large images slow loading, and slow loading can hurt LCP. The fix starts before you upload.
Resize to the size you will display. If your content column is 800 pixels wide, a 4,000 pixel photo is mostly wasted data. A good rule is the largest size the image will ever appear, and no bigger. For retina screens, allow for a larger version through responsive images (more below).
Know what WordPress does. WordPress scales images above 2,560 pixels in height or width down on upload, and keeps the original file in your uploads folder. This is the “big image” feature added in WordPress 5.3, and you can change the threshold with the big_image_size_threshold filter. WordPress also generates several smaller sizes of each upload. These help, but they do not shrink your original file.
Compress. Export JPEG and WebP at a quality setting that looks clean at the displayed size. Tools such as Squoosh and your editor’s export dialog work well, and WordPress plugins can compress on upload. Check a few images by eye before you apply a setting to the whole library.
For a full speed review of a WordPress site, including images, our WordPress speed optimization service starts with the heaviest assets.
How do responsive images work in WordPress?
Responsive images let the browser pick a file that fits the screen. Google’s documentation says to use the srcset attribute on img, or the picture element, and to always include a fallback src, because some browsers and crawlers do not understand these attributes.
An example:
<img src="shoes-800.webp"
srcset="shoes-400.webp 400w, shoes-800.webp 800w, shoes-1600.webp 1600w"
sizes="(max-width: 600px) 100vw, 800px"
width="800" height="533"
alt="Red running shoes on a track">
Here srcset lists the candidate files, sizes tells the browser how wide the image will be, and src is the fallback.
In WordPress you rarely write this by hand. When you add an image with the block editor, WordPress outputs a srcset from the sizes it generated. Check this on a live page: right-click the image, choose Inspect and look for srcset in the img tag. If your theme or page builder strips it, ask your developer to restore it.
Use the picture element to offer different formats, and always end with an img fallback.
Should you lazy-load images? The LCP caution
Lazy loading means the browser delays loading an image until it is near the viewport. It saves data and speeds up the first view. But lazy loading the wrong image is one of the most common causes of a slow LCP.
The rules, per web.dev:
- Use
loading="lazy"on images that are off screen when the page first loads. - Do not lazy-load images visible on initial load, especially the LCP image.
- Always set
widthandheightonimgtags so the browser can reserve space. This matters even more with lazy loading, because missing dimensions can increase Cumulative Layout Shift. A good CLS is 0.1 or less. loadingworks only onimgandiframe, not on CSS background images.
web.dev’s LCP optimization guide is blunt: “Never lazy-load your LCP image.” It also advises keeping the LCP image discoverable in the initial HTML, adding fetchpriority="high" to it, and using that attribute on one or two images at most. For hidden images, such as inactive carousel slides, fetchpriority="low" frees bandwidth.
What WordPress does for you. According to the WordPress 6.3 developer note, WordPress adds loading="lazy" unless an image is likely in the viewport. In 6.3 it also adds fetchpriority="high" to the first large image it judges most likely to be the LCP image, and it never sets high priority and lazy loading on the same image. Images smaller than 50,000 pixels (width times height) are not eligible. Attributes you set by hand are kept.
That helps, but it is a guess. Plugins, page builders and sliders can break it. Check your hero image in the page source. If it shows loading="lazy", fix it. If your LCP is slow, our guide to improving LCP in WordPress shows how to trace it, and the Core Web Vitals assessment failed guide covers the wider fix.
How does page context affect image SEO optimization?
Google does not judge an image on its own. It looks at the page around it. Google’s image guidance says to place images near relevant text and to optimize the page that hosts them.
Do these things:
- Put the image close to the text it supports. A product photo belongs next to the product description. A diagram belongs next to the paragraph it explains.
- Use real HTML
imgelements. Google states that it does not index CSS images, so a photo set as a CSS background will not be picked up. Useimgfor content images and CSS for pure decoration. - Write a clear caption when it helps readers.
- Pick a preferred image for the page. Google says you can signal a preferred image with structured data such as
primaryImageOfPageormainEntityOfPage, or theog:imagemeta tag. Use a sharp, high-resolution image and avoid logos, images with text and extreme aspect ratios. - Make the page itself good. Follow the page’s title and snippet guidelines and make sure the page is useful on its own. A weak page rarely carries a strong image.
Good image SEO optimization depends on content and structure too. Our on-page SEO checklist for beginners covers headings and titles that give an image the right context.
Do you need an image sitemap?
Not always. Google says an image sitemap helps it find images it might otherwise miss, such as images loaded through JavaScript. If your images are normal img tags in HTML and your pages are well linked, Google can usually find them without extra help.
If you do need one, Google’s image sitemap documentation gives the format:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/shoes/</loc>
<image:image>
<image:loc>https://example.com/images/red-running-shoes.webp</image:loc>
</image:image>
</url>
</urlset>
Key points from the documentation:
image:locis the only required child tag.- Each
urlentry can list up to 1,000image:imagetags. - The caption, geo location, title and license tags are no longer documented, so skip them.
- Images can sit on another domain, such as a CDN, if you verify both domains in Search Console.
On WordPress, many SEO plugins add images to the regular sitemap for posts and pages. Check your sitemap file to see what is listed before you add anything new. For plugin setup, see our WordPress SEO setup guide.
What about structured data for images?
Use structured data only when a Google feature documents it. Google’s image guidance says to follow the general structured data guidelines plus any guidelines for your data type, and that the image property is needed for eligibility for a badge and rich result in Google Images for the structured data types that support it.
In plain terms: when you add markup that supports an image property, include a good one that points to a real, crawlable image. You do not need image markup on every picture, and we do not recommend markup types Google does not document for your content. Our guide to schema markup in WordPress shows how to add the right types safely.
How to optimize images for SEO in WordPress: step by step
Here is an image SEO optimization workflow you can repeat for each new image. Admin names come from the standard WordPress interface.
- Choose the right image. Pick an original, sharp, relevant image. Avoid images with a lot of text baked in.
- Name the file. Rename it with a short, descriptive, hyphenated name before upload.
- Resize and compress. Resize to the largest size it will display, then export as WebP or JPEG.
- Upload in the Media Library. Go to Media, then Add New, and upload the file.
- Write alt text. Click the image, and in the Attachment details panel, fill in Alternative Text. In the block editor, select the image block and use the Alternative text field in the sidebar.
- Place it near relevant text. Add the image block close to the paragraph it supports.
- Check width and height. View the page source. The
imgtag should havewidthandheight. - Check loading. Make sure your top image is not
loading="lazy". Lower images can be lazy. - Check the sitemap and crawling. Confirm your image URLs are crawlable and not blocked in robots.txt.
- Test speed. Run PageSpeed Insights on the page and look at LCP, CLS and image warnings.
For a large media library, start with your home page, top landing pages and top posts. A bulk plugin can convert old images, but test a sample first and keep backups.

Image SEO optimization checklist
Use this image SEO optimization list when you publish a page, and again in a content audit.
- [ ] File name is short, descriptive and hyphenated
- [ ] Alt text describes the image in context, without keyword stuffing
- [ ] Decorative images use empty alt text
- [ ] Image is a real HTML
img, not a CSS background, if it carries meaning - [ ] Image is sized to its display area, not far larger
- [ ] File is compressed, in WebP or JPEG (AVIF where supported)
- [ ]
widthandheightare set - [ ]
srcsetandsizesare present, with a fallbacksrc - [ ] Top image is not lazy-loaded and has
fetchpriority="high"when it is the LCP image - [ ] Lower images use
loading="lazy" - [ ] Image sits near relevant text
- [ ] Image URL is consistent across pages and not blocked by robots.txt
- [ ] Image sitemap added if images might be missed
- [ ] Page tested in PageSpeed Insights

Common image SEO optimization mistakes
- Lazy-loading the hero image. This delays LCP. Leave the top image eager and give it high fetch priority.
- Stuffing alt text with keywords. Google says it can be seen as spam. Describe the image.
- Uploading full camera files. A huge photo in a small slot slows every visit.
- Using CSS backgrounds for content images. Google does not index CSS images.
- Missing width and height. The page jumps as images load, which hurts CLS.
- Generic names like image1.jpg. Use descriptive names.
- Different URLs for the same image. Reuse the same file URL across pages.
Next steps for image SEO optimization
- Run PageSpeed Insights on your top five pages and note any image warnings and your LCP element.
- Check each LCP image in the page source. Remove
loading="lazy"from it and addfetchpriority="high". - Fix alt text on your top ten pages first. Describe, do not stuff.
- Compress and resize the heaviest images, and convert large PNG photos to WebP or JPEG.
- Make sure content images are HTML
imgtags with width and height. - Check your sitemap. Add an image sitemap only if you have images Google may miss.
- Re-test after a few weeks. Google’s guidance is that changes take time to show.
If image SEO optimization is part of a wider site review, our SEO services include it, and the WordPress SEO services team can apply fixes directly.
Want us to optimize your images?
If you would like a second pair of eyes on your image SEO optimization, we are happy to look. We will check your top pages for heavy images, lazy-loaded hero images, missing alt text and sitemap gaps, then send you a plain list of fixes. See how our SEO team works, then contact us with your site address for a free review.
FAQ
What is image SEO optimization?
Image SEO optimization is preparing images so search engines can find and understand them, and so they do not slow your page. It covers alt text, file names, formats, sizing, responsive images, lazy loading, page context and sitemaps. It helps visibility in Google Images and supports faster pages, but does not guarantee rankings.
Does image alt text affect SEO?
Yes. Google calls alt text the most important metadata attribute for an image, and it also helps accessibility. Write short, useful descriptions that fit the page, and avoid stuffing keywords. Google warns that stuffing can be seen as spam. Use empty alt text for decorative images.
What is the best image format for SEO?
There is no single best format. Google supports JPEG, PNG, WebP, GIF, BMP, SVG and AVIF. For most sites, WebP is a good default for photos, JPEG is a safe fallback, PNG suits transparency, and SVG suits logos and icons. Pick the format that gives a small file at good quality.
Does lazy loading hurt SEO?
Not if you use it correctly. Lazy-load images below the fold, but never the LCP image, which is usually the hero image. web.dev says never to lazy-load it, because it delays the request and hurts LCP. Always set width and height, and use fetchpriority high on the main image.
Do I need an image sitemap?
Not always. Google says image sitemaps help it find images it might otherwise miss, such as those loaded through JavaScript. If your images are normal HTML img tags on well-linked pages, you may not need one. Many WordPress SEO plugins add images to the regular sitemap already.
How do I add alt text to images in WordPress?
In the block editor, click the image and fill in the Alternative text field in the right sidebar. In the Media Library, click the image and fill in Alternative Text in the Attachment details panel. Write a short, accurate description. Leave it empty only for decorative images.
How big should images be for a website?
Size images to the largest dimensions they will display, then compress them. A 4,000 pixel photo in an 800 pixel column wastes data. WordPress scales uploads above 2,560 pixels down automatically, but that is a ceiling, not a target. Use responsive images with srcset so phones download smaller files.
Does WordPress optimize images for SEO automatically?
Partly. WordPress generates multiple sizes, adds responsive srcset markup, lazy-loads images that are not likely above the fold and, since version 6.3, adds fetchpriority high to the likely LCP image. It does not write alt text, choose good file names or shrink your original files. Those steps are yours.