Image SEO: Alt Text, File Names, and Beyond
Images are not just visual content. They are searchable assets. Google Images accounts for over 20% of all web searches, and visual search through tools like Google Lens continues to grow. For many sites — especially e-commerce, travel, and recipe publishers — image search drives a significant share of organic traffic.
Yet most image SEO advice stops at compression. While optimizing file size is essential for performance and rankings, search engines rely on a much broader set of signals to understand, index, and rank images. Descriptive file names, well-written alt text, structured data, sitemaps, and surrounding page context all play a role.
This guide covers the full picture of image SEO, from the fundamentals that every site should get right to the advanced techniques that separate top-ranking pages from the rest.
Why Image SEO Matters
Google Images is the second-largest search engine in the world. When your images rank well, they create an additional entry point to your content that text-based results alone cannot provide. A user searching for “modern kitchen renovation” may click through from an image result rather than a traditional blue link.
Visual search is accelerating this trend. Google Lens processes billions of queries, and users increasingly expect to search by pointing their camera at something rather than typing a description. Images that are properly optimized for search are more likely to surface in these visual results.
Beyond discovery, image SEO contributes to overall page quality signals. Pages with accessible, well-structured images tend to score better on user experience metrics, which in turn supports broader SEO goals.
Descriptive File Names
Search engines read file names. An image called hero-banner-kitchen-renovation.jpg tells Google what the image contains before any other signal is considered. An image called IMG_4032.jpg or DSC00491.png tells it nothing.
Rename your image files before uploading them. Use lowercase letters, separate words with hyphens, and describe the content concisely:
- Good:
blue-ceramic-coffee-mug.jpg - Good:
downtown-chicago-skyline-sunset.webp - Bad:
IMG_4032.jpg - Bad:
photo-final-v2-REVISED.png - Bad:
image1.jpg
Keep file names descriptive but not stuffed with keywords. A name like best-cheap-coffee-mug-buy-online-discount-sale.jpg reads as spam to both users and search engines. Aim for a natural description of what the image actually shows.
File names are set permanently once an image is indexed. Changing a file name later means changing the URL, which requires a redirect to preserve any ranking equity the image has accumulated.
Writing Effective Alt Text
The alt attribute on an <img> tag serves two critical purposes: it provides a text alternative for users who cannot see the image (screen reader users, users on slow connections where images fail to load), and it gives search engines a direct textual description of the image content.
Best Practices for Alt Text
Be specific and descriptive. Describe what the image shows, not what it is for.
<!-- Good -->
<img src="team-photo.jpg" alt="MegaOptim engineering team at the 2023 company retreat in Ohrid">
<!-- Bad -->
<img src="team-photo.jpg" alt="photo">
<!-- Bad -->
<img src="team-photo.jpg" alt="team image picture company photo about us">
Keep it concise. Aim for one to two sentences at most. Screen readers announce alt text in full, and overly long descriptions degrade the experience for assistive technology users.
Avoid keyword stuffing. Search engines penalize alt text that reads as a list of keywords rather than a natural description. Write for the person who cannot see the image and needs to understand what it conveys.
Do not start with “image of” or “picture of.” Screen readers already announce the element as an image. Adding these phrases is redundant.
Use empty alt for decorative images. If an image is purely decorative and carries no informational content — a background gradient, a divider line, a decorative border — use an empty alt attribute (alt=""). This tells screen readers to skip it and signals to search engines that the image is not meaningful content.
<img src="decorative-divider.svg" alt="">
Title Attributes
The title attribute on images provides supplementary information that appears as a tooltip on hover. It is not a substitute for alt text and carries minimal SEO weight on its own. However, it can enhance user experience by providing additional context, such as photo credits, dates, or supplementary details that do not belong in the alt text.
<img src="lake-ohrid.jpg" alt="Lake Ohrid shoreline at dawn" title="Photographed in June 2023 from Kaneo Beach">
Do not duplicate your alt text in the title attribute. If you use title, make it genuinely additive.
Image Sitemaps
Standard XML sitemaps help search engines discover your pages. Image sitemaps extend this by explicitly listing images and their metadata, making it easier for crawlers to find images that might otherwise be missed — particularly images loaded via JavaScript, referenced in CSS, or embedded in complex page structures.
You can add image information to your existing sitemap:
<url>
<loc>https://www.example.com/kitchen-renovation-guide</loc>
<image:image>
<image:loc>https://www.example.com/images/modern-kitchen-white-cabinets.jpg</image:loc>
<image:caption>Modern kitchen with white cabinets and marble countertops</image:caption>
</image:image>
<image:image>
<image:loc>https://www.example.com/images/kitchen-before-after.jpg</image:loc>
<image:caption>Kitchen renovation before and after comparison</image:caption>
</image:image>
</url>
Image sitemaps are especially valuable for sites with large image libraries, such as stock photo sites, e-commerce catalogs, and portfolio sites. They ensure that Google discovers every image you want indexed, not just the ones it encounters during a standard crawl.
Structured Data for Images
Schema.org structured data allows you to give search engines explicit, machine-readable information about your images and the content they relate to. Products, recipes, articles, and how-to guides all support image properties in their structured data schemas.
For example, a product page can include the product image directly in its JSON-LD markup:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Ceramic Coffee Mug",
"image": [
"https://www.example.com/images/blue-ceramic-coffee-mug.jpg",
"https://www.example.com/images/blue-ceramic-coffee-mug-side.jpg"
]
}
This structured data helps Google associate your images with rich results — product carousels, recipe cards, and other enhanced search features that prominently display images. Pages with structured data that includes images are more likely to appear in these high-visibility placements.
Surrounding Page Context
Search engines do not evaluate images in isolation. The text surrounding an image — headings, captions, paragraph content, and page title — all contribute to how Google understands what the image depicts and how relevant it is to a given search query.
Captions matter. Studies by search engine researchers have shown that captions are one of the most-read elements on a page. A descriptive caption beneath an image reinforces the image’s relevance to both users and crawlers.
Place images near relevant text. An image of a kitchen renovation will rank better for kitchen-related queries when it appears within a section that discusses kitchen design, rather than floating in an unrelated part of the page.
Use descriptive headings. The heading above or nearest to an image provides strong contextual signal. If your H2 reads “Modern Kitchen Design Trends” and the image beneath it shows a modern kitchen, the alignment strengthens the image’s relevance for that topic.
File Size and Page Speed as Ranking Factors
Image file size affects SEO in two ways. First, page speed is a direct ranking factor. Google has confirmed that page experience metrics, including Core Web Vitals, influence search rankings. Uncompressed images are typically the largest contributor to slow page loads, dragging down Largest Contentful Paint scores and hurting overall page performance.
Second, Google’s crawl budget is finite. Extremely large images consume more bandwidth during crawling, which can reduce how many pages Google crawls on your site within a given time window. This is particularly relevant for large sites with thousands of images.
Compressing images with a tool like MegaOptim reduces file sizes by 60-80% without visible quality loss, using perceptual quality metrics to find the optimal balance. Smaller files load faster, improve Core Web Vitals, and allow search engines to crawl more of your content efficiently.
Open Graph and Social Sharing Images
When someone shares a link on social media, the platform pulls an image from the page’s Open Graph tags. A missing or poorly chosen OG image means the platform either shows nothing or selects an arbitrary image from the page, which can undermine click-through rates.
<meta property="og:image" content="https://www.example.com/images/kitchen-guide-social.jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Complete guide to kitchen renovation with before and after photos">
For best results across platforms, create social sharing images at 1200 x 630 pixels. This ratio works well on Facebook, LinkedIn, and X (formerly Twitter). Optimize these images for file size as well — social platforms may time out on fetches of very large files.
Twitter (X) also supports its own card meta tags. Including both OG and Twitter card tags ensures consistent presentation across platforms.
Common Mistakes
Using CSS background images for meaningful content. Search engines do not reliably index CSS background images. If an image conveys information or should appear in image search, use an HTML <img> tag.
Blocking images in robots.txt. If your robots.txt prevents Googlebot from accessing your image files or image directories, those images will never be indexed. Verify that your robots.txt does not inadvertently block image resources.
Ignoring responsive images. Serving a single 3000px-wide image to all devices wastes bandwidth on mobile and hurts page speed. Use srcset and sizes to serve appropriately sized images for each viewport.
Lazy loading above-the-fold images. Lazy loading is excellent for images below the fold, but applying it to your hero image or primary content image delays its load and harms LCP. Only lazy load images that are not immediately visible when the page first renders.
Duplicating images across many pages without variation. If the same image appears on dozens of pages with identical alt text, search engines may consolidate those signals rather than ranking each page independently. Where possible, use unique images or at least vary the alt text to reflect each page’s specific context.
Bringing It All Together
Image SEO is not a single checklist item. It is a combination of technical implementation, content strategy, and performance optimization working together. Start with the fundamentals — descriptive file names, accurate alt text, and compressed file sizes — then layer on sitemaps, structured data, and thoughtful page context as your site matures.
Every improvement compounds. A well-named, properly compressed image with strong alt text, placed within relevant content and backed by structured data, has a far better chance of ranking than an unnamed, unoptimized image dropped onto a page without context. The effort you invest in image SEO pays dividends across organic search, image search, visual search, and social sharing alike.