Websites have become a lot more visual over the years, and nowadays it is not only a good idea to use images – but actually necessary if you want to make your website appealing.
The right image can provide invaluable context to visitors, and break up what would otherwise be a wall of text. But search engines can’t ‘see’ images the way that humans do, which is part of the reason why it is important that you specifically optimize your images for search engines.
Don’t worry if that sounds complicated, because it is actually rather easy once you know what you need to do.
9 Tips to Optimize Images for Search Engines
1. Name Image Files Descriptively to Provide Context
Imagine for a minute that you are a search engine bot and you run into an image named Image0001.jpg. The file name doesn’t really tell you much apart from the fact that it is presumably the first image in a series.
If the image used a more descriptive file name such as dark-colored-shirt-XL.jpg on the other hand – more information could be gleaned from it. A search engine bot would be able to surmise that the image is of a shirt in a dark color that has an XL size.
That pretty much sums up why naming image files descriptively is always a good idea. The context that it provides is invaluable, and will definitely help search engines understand the image.
When you name your image files descriptively there are a few rules to follow:
- Use hyphens (-) to indicate spaces, and not underscores (_).
- Use plain language that is relevant to the image.
- Do not make it too long.
- Avoid keyword stuffing that does not add context.
2. Add ALT Attributes to Images
Every image that you publish on your website should have an alt attribute added to it. That alt attribute will specify an alternative text that will be displayed if the image cannot be loaded – and more importantly, will provide invaluable additional information to search engines.
The only images that should not have alt attributes are images that exist purely for decorative purposes – and do not contribute any other value or information.
As you can imagine, it is best for the alt attributes to be descriptive so that they can act as an alternative to the image itself – just like the file name. However alt text can be longer than the file name, allowing you to describe the image’s contents more effectively.
Only add keywords to alt text if they are natural and fit the image. Keyword stuffing of alt text is never a good idea, and should be avoided.
3. Place Captions Below Images
Another useful way to give search engines (and visitors) more information about your images is by placing a caption below them.
Essentially a caption is just a small line or paragraph of text that is normally placed directly below the image in its own box that describes the image and what it is about. That context can be invaluable to visitors, and search engines will benefit in a similar fashion.
As with alt-text, captions should not be added to decorative images. In fact they should only be added to images where the additional context would be required and appropriate.
4. Use the Right Image Format
The format that you choose to save images in is important when you are going to be publishing them on a website. In particular there are a few common formats that you should use for almost all of your images:
- JPEG or WebP should be used for the majority of larger images and photos and will provide decent quality at small file sizes. Although WebP has better compression than JPEG, it is less widely supported.
- PNG should only be used for images with transparent backgrounds – and even then only if the transparent background is really necessary.
- SVG is perfect for logos and icons, and will allow you to scale both as required by using CSS itself.
Although at one stage GIF was a popular online image format, it is far less popular nowadays – mostly because of how inefficient it is. It is better to use video formats as opposed to animated GIFs, or use PNG for transparent backgrounds.
5. Display Responsive Images Based on Screen Width
All search engines nowadays are placing a heavy emphasis on the need for websites to be mobile-friendly and cater to devices with different, smaller, screen sizes.
To make sure that your images are mobile-friendly, you should display responsive images that are based on the screen width. That can be done using the srcset attribute that will let you define a different image in the appropriate size to be displayed, based on the width of the screen.
Not only will search engines appreciate the fact that your images are mobile-friendly, but it will also help your website load more efficiently because (ideally) the right size of images will be displayed.
For example, instead of loading a large 1000×1000 pixel image to be displayed at 200×200 pixels, you could load a much smaller image instead.
6. Watch the Page Speed Closely
By this point you may have noticed that the image file size is important, and it is part of the reason why responsive images and images in the right format are important.
The actual reason why the image file size itself is important is because it has a big part to play in the page speed of your website, i.e. the time that it takes for a webpage to load.
Over the last few years search engines have started to evaluate the page speed of websites more closely. That is because many visitors won’t wait ages for websites to load, and as such search engines would prefer giving a higher ranking to websites that load faster.
Seeing as the time that it takes to load images will have a significant impact on your page speed, you need to watch it carefully and make sure it isn’t slowing it down too much. If it is you may need to take steps above and beyond the format and responsiveness of the images.
Some of the steps that you could take to optimize images and improve the page speed are to:
- Lower the quality of JPEG (or WebP) images to make the file size smaller.
- Reduce the overall number of images on the webpage.
- Use tools that can optimize images for the web by removing EXIF data.
- Host images on a reliable Content Delivery Network (CDN) if your webserver can’t cope.
7. Submit an Image Sitemap
Submitting an image sitemap to Google and other search engines can provide them the URLs of any images that are used on its pages. That will make it easier for the search engines to ‘discover’ your images, and list them properly.
Unlike regular XML sitemaps, image sitemaps do not have a cross-domain restriction. In other words you can list any of your images that are hosted elsewhere – such as on CDNs.
While listing the location (i.e. URL) of images on a webpage is enough, if you want you can go a step further and provide other details as well. The image sitemap can contain information such as the caption, geographic location, title, and license.
8. Add Structured Data
As you may have noticed search engines nowadays have ‘rich’ results that display a more fleshed-out listing that looks far better. If you want your images to be featured in such results, you need to add structured data to them.
The best way to start adding structured data is to go over the guidelines for the specific type of data that you want to add. Nowadays there are lots of resources that you can refer to, though Google’s guide on structured data is still the best place to start.
By adding structured data and having your listing displayed as a rich result, your image is more likely to get attention and clicks.
9. Test Images Carefully
If and when you publish any image on your website – you should test it carefully. Make sure that it loads, and if it is responsive try testing it on different screen sizes.
After that check its file name, alt text, caption, format, sitemap entry, structured data, and the impact that it has on the page speed.
The tests should help you to ensure that all the images that you publish are optimized for search engines, and none fall through the cracks. Assuming you’re running a large website you may want to periodically check all your images from time to time, to make sure that there are no issues.
Ultimately if you optimize your images properly, you will find that they rank and are listed better on search engines – and your website as a whole should rank better as well.