Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
30 Million+
Websites using our plugins
20+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Beginner’s Guide to Image SEO for WordPress

Does image SEO really bring traffic, or is it just another SEO task that keeps you busy?

Most website owners optimize their text for search but treat their images as an afterthought. That can mean missing opportunities to appear in Google Images and AI answers.

In this guide, you’ll learn how to optimize images in WordPress and turn them into another way for people to find your website.

Beginner’s Guide to Image SEO for WordPress

Here’s what we’ll cover in this article:

Rename Your Image Files Before You Upload

Rename your image files before uploading them to WordPress. A descriptive filename gives search engines a light clue about what an image shows and helps them understand its relevance to the page.

For example, if you are adding a photo of a red wooden house, rename DSC00434.jpeg to red-wooden-house.jpeg. Avoid generic names, camera-generated numbers, or filenames that don’t describe the image.

Use hyphens (-) to separate words in your filenames rather than underscores (_). Search engines can interpret hyphens as spaces between words, making red-wooden-house.jpg easier to understand than red_wooden_house.jpg.

You don’t need to stuff keywords into your filenames. Instead, use a short, descriptive name that matches the image.

Write Alt Text That Helps SEO and Accessibility

Alt text is a short description added to an image in HTML. It helps screen readers describe the image to visitors and gives search engines useful information about it.

Write alt text that clearly describes the image and fits the context of your article. Google uses alt text, together with the surrounding content, to understand what the picture shows.

For example, if you are writing about growing tomatoes, an image of tomato plants in a garden could use alt text like Tomato plants growing in a raised garden bed.

Add alt text to an image in WordPress

If your site already has hundreds of images without alt text, you don’t have to update them one at a time. You can connect your site with an AI tool, like ChatGPT via the free WPVibe plugin and generate alt text in bulk with it.

You can also follow our guide on automatically generating image alt text with AI to explore other options.

How Long Should Alt Text Be?

Google sets no character limit for alt text. The common 125-character guideline actually comes from how older screen readers, like JAWS, used to cut off long alt text into chunks.

Focus on the details that help people understand the image rather than trying to reach a specific length. Here are a few examples:

Too vagueBetter alt textMore descriptive alt text
BreadLoaf of bread on a tableSourdough bread cooling on a wire rack
JapanTourists visiting JapanTourists visiting the Fushimi Inari Shrine in Kyoto, Japan
WordPress dashboardWordPress site editorWordPress site editor showing the homepage template

Start with the most useful part of the description rather than phrases like “image of” or “picture of.” Screen readers already identify the content as an image, so those words only add extra noise.

If the image needs a longer explanation, put that information in the surrounding content or a caption instead of trying to fit everything into the alt text.

Optimize Image Title, Caption, and Description

WordPress gives you several fields for describing an image, like Title, Caption, and Description.

They serve different purposes, but clear image information can help search engines and AI systems understand what an image shows and how it relates to your content.

Keep in mind that editing these fields in the Media Library does not update images you’ve already placed in posts or pages. You’ll need to edit those images directly where they appear.

Image Title

The image title helps you identify and organize images in the WordPress Media Library. Plus, it can help AI search tools understand your content.

Image Description

The description field lets you add additional information about an image in your WordPress Media Library.

Add an image description in WordPress

Image Caption

A caption appears below the image and gives visitors additional context. Use one when you need to explain an image, provide attribution, or point out an important detail.

Add a caption to an image in WordPress

Google specifically says it uses image titles and captions to understand images. Keep your captions clear and relevant to the image and the page.

Resize and Compress Images to Speed Up Your Site

Large image files can slow down your pages, which can hurt rankings and make visitors more likely to leave. Resizing and compressing your images is one of the easiest ways to improve page speed.

Before uploading an image to WordPress, resize it to the largest size your site needs. There’s no reason to upload a 4000-pixel-wide image if your website displays it at only 1200 pixels wide.

Next, compress the image to reduce its file size without noticeably reducing its quality.

Compression can also remove camera metadata that visitors never see, making the files even smaller. At WPBeginner, we use TinyPNG to compress images before uploading them.

Optimized vs Unoptimized Images in WordPress

You can also use plugins such as EWWW Image Optimizer or Optimole to automate image compression.

For step-by-step instructions, see our guide on how to optimize images for web performance without losing quality.

Choose the Right Image Format

The right image format can help you balance image quality and file size. Here’s what to use for the most common types of images:

Image FormatBest for
WebPA good choice for most photos and graphics. It provides good image quality with smaller file sizes than older formats such as JPEG and PNG.
AVIFPhotos and other detailed images when you want very small file sizes. It offers excellent compression, but some image editors and older tools can’t open or export it.
JPEGPhotos and other images with many colors. It remains a practical choice when you need a widely supported format.
PNGLogos, screenshots, and graphics that need transparency or sharp details.
SVGSimple logos, icons, and other vector graphics that need to stay sharp at different sizes.

You can learn more about the differences between WebP, PNG, and JPEG in our guide to the best image format for WordPress.

Serve Images Fast: Lazy Loading, Responsive Images, and a CDN

WordPress automatically lazy loads images that aren’t immediately visible on the screen and uses responsive images with srcset so browsers can download an appropriate image size for each screen.

The main thing to keep an eye on is your Largest Contentful Paint (LCP), the time it takes the largest visible element on the page to load.

If your main image appears near the top of the page, you don’t want lazy loading to delay it. WordPress already skips lazy loading for the first three images on a page.

If you use a plugin like Optimole, you can change how many leading images are excluded from lazy loading. For more tips, see our guide on how to easily lazy load images in WordPress.

Skip lazy loading for the first 2 images in Optimole

If your site has visitors around the world or serves many large images, a content delivery network (CDN) can help by sending your files from a server closer to each visitor.

Help Google Find Your Images: Image Sitemaps and Structured Data

Most WordPress sites don’t need a separate image sitemap. Google can usually discover images by crawling the pages where they appear.

An image sitemap can help if you have a large, image-heavy site or use images that are difficult to discover through normal navigation and internal links.

If you use AIOSEO, you don’t need to create a separate image sitemap because it adds your images to its XML sitemap by default.

See our guide on creating a sitemap in WordPress for details.

Include images in your XML sitemap in AIOSEO

For content where images are an important part of the result, structured data can give Google more information about the page.

For example, Product schema can describe a product’s image, price, and availability, while Recipe schema can provide information about a recipe and its image.

These details can help Google understand the page and may make it eligible for richer search results.

Add a product's image to the product schema

You don’t need a special schema for AI Overviews or AI Mode. Google can use the same SEO signals to understand your content, so only add structured data when it fits your page.

For more information, follow our guide on how to use rich snippets in WordPress.

Video Tutorial

Subscribe to WPBeginner

Frequently Asked Questions About Image SEO

Is WebP better than JPEG or PNG for SEO?

No, Google does not give any image format a ranking advantage.

WebP can provide good quality at a smaller file size, but JPEG, PNG, AVIF, and SVG each have situations where they make more sense. Choose the format that gives you the right balance of quality and file size.

Can people find my website by searching with a photo?

Yes, Google Lens lets people search with an image to find similar images, identify objects in the image, and discover websites that use the same or similar image.

How do I get my images into Google AI Overviews and AI answers?

There is no special image SEO trick that guarantees placement in AI Overviews or AI Mode. Google recommends the same SEO fundamentals it uses for regular search.

This means creating helpful content, providing a good page experience, keeping your pages crawlable, and using high-quality images that enhance your content.

Additional Resources on Optimizing WordPress Images

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

41 CommentsLeave a Reply

  1. Code after “If you are familiar with code, then you can also do this manually by adding the following code directly to your theme’s functions.php file.” seems to be incomplete. Shouldn’t there be:

    function wpb_redirect_attachment_to_post () {

    before

    if ( is_attachment() ) {

    ?

  2. Does image format have any effect on SEO? Is it jpeg, webp or png? I use webp because of the size, is there a better chance for SEO that google may prefer this type of image for its size?

    • Unless we hear otherwise, there is not a SEO advantage to the image format, it would be best to use the image format that fits the use of the image best.

      Admin

      • Thanks for the reply, I was hoping that Google would prefer a custom image format and also that it would prefer the size. Damage. Anyway, thanks for the reply. I use webp on the Web and will continue to use it.

  3. “Note: Changing an image’s alt tag or caption via Media Library will not change it in the posts and pages where the image is already used.”

    If this is the case how can i adjust the alt tags of the images already in use?

  4. Is it OK to edit all these photos in my WP Dashboard Media Library if the website and individual pages are already published and live? Do I need to delete each photo and reload a copied version of photo that has correct Alt Tags, Title, Description?

    • If you made changes in the media library to image tags, you would need to re-add the images for the information to be what you have changed it to for media already on your site.

      Admin

  5. That was a great explanation. I’ve been searching for this specific type of information for days, your’s was the best I found. Thank you!

  6. Re: image size – I have uploaded images 1200x1200px @around <1mb. Does it make sense to reduce the file size directly in WP (e.g. insert images not in 'full size' but rather in 'large', 'medium' etc)? Or do i have to take care of image size when directly uploading the images from my hard drive? Thanks

    • At that point, it becomes more of a personal preference question but we prefer to optimize and resize images before uploading them to a WordPress site if that is what you mean.

      Admin

  7. Hi,

    Thank you for sharing the image optimization tips. My concern is a different thing. For example, I published one blog post including an image. Later, I want to remove that image from the post and add a new one. If I remove it and add a new image. Will it affect my sites SEO?

    • It shouldn’t have a major ranking change for your site’s SEO if you change the image.

      Admin

    • That field is for displaying text on the image attachment page or below the image depending on your theme’s design rather than something major for SEO at the moment

      Admin

  8. Hello! Thank you so much for this information. I have been looking for a post like this for a while now.

    For the pictures of myself that go under my “About me” section in my blog, do they still need metadata?

  9. Hey,

    Thanks for the great article.

    Are there any specific guideline for adding alt text to bog cover image

    • You would follow it the same as you would for other images, when selecting the image you should have the option to edit the tags with the media uploader

      Admin

  10. Hi:

    Great article!!!
    I got a question, you said : “Changing an image’s alt tag or caption via Media Library will not change it in the posts and pages where the image is already used.”
    Does that mean I need to reinsert image again after add alt tag in Media Library?
    Thank you

    • After you set it up in the media library, once you attempt to add it to a post, it should bring in tags you set in the media library

      Admin

  11. This is most helpful, Syed, especially your explantation about “How to Add Alt Text, Title, and Caption to Images in WordPress”.

    Thank you.

  12. I’ve been doing SEO since before Google existed. I came to read this just for fun and because I trust WP beginner.

    I actually learned something.

    I had no idea the alt tag was used in Google image search to describe the image.

  13. Due to time constraints and sheer volumes of photos I am asked to post on over 5 websites I manage for my organization, I often neglect the metadata and regret it later on. This is a very important article and a great incentive for all of us to organize our media libraries from the get go and discipline ourselves with each image added to provide this info. (Not to mention our posts and pages!)

    Thank you.

  14. Wow! Great article again. I need this to improve my images. Yes, I’m using Yoast SEO, but never thought of using it to improve images on my site, especially turning off the “attachment pages”.

    Thanks for helping me find the best WordPress tips when I need them. You have taught me a lot of things.

    John Shalom

  15. Should I use original files from stock photo. Because the images are high resolution and size. And gtmetrics suggested to use optimised photos…

    • Depending on where you got the stock photo from, you would want to check their license agreement to be sure that is allowed.

      Admin

    • If your browser automatically accepted our push notifications for some reason, you should be able to right-click the notifications to stop them.

      Admin

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.