CDN SEO: Indexing Images in SERPs
SEO plays a very vital role when it comes to the success of your website, and a small part of that includes your images appearing in Google image search correctly. There is sometimes confusion about how a CDN handles images and so in this post we show you the best practices for indexing images in SERPs while using a content delivery network.
Importance of images in SERPs
From our experience, image search potential is always underestimated. If you don't setup your CDN properly, your images might not be indexing at all and you could be missing out on a lot of potential traffic from Google image search. Just how much traffic are talking about? Let's take a look at some of the data.
- According to a case study by Brafton Marketing, 63% of Google image search clicks turn into site traffic. Obviously this will vary from niche to niche, but that is a lot.
- Chris Pearson did an analysis of his images searches vs total searches going back five years. He discovered that over a 5 month period over 53% of his total searches came in the form of image searches.
So let's say your images are clicked on 500 times in Google image search over the period of a month and you sell a product with a conversion value of $50.00. If 63% of that image traffic converts to site traffic, and a mere 3% of that converts into a customer, that is potentially an additional $472.50 in sales simply from indexing your images correctly.
Easy win
Now of course the quality of image traffic will always vary depending upon the topic of the site, and might not always convert. For example, a blog about finance where they also sell services might have a harder time converting image traffic than an ecommerce website where people are searching for pictures of specific furniture and are ready to buy.
Either way still think of Google image search as an easy win. Partially because there is less competition and also because the competition is less likely to be properly optimized. Also, as long as you SEO your images properly and index them, there really is no extra work involved.
Ways to track Google image search traffic
You can track your google image search traffic by looking at your referral traffic in Google Analytics and looking at the search analytics in Google Search Console. Follow the steps below:
Google Analytics
By default it seems Google Analytics doesn't always pass the correct referrer, and so it is recommended to set up additional filters to see a more accurate data.
- In Google Analytics click into "Referrals" under "Acquisition."
- Search for "Google" and you will most likely get the different international versions of Google that come up. In our example, we will be using the U.S. one so click into "google.com."
- Click into the referral path of
/imgres
- Add "Landing Pages" as a secondary dimension. And you will now see which pages are getting click into from SERPs. It's not perfect as you can't narrow down exact images (unless the page only has one image), but it helps to know which pages are getting traffic from Google Image Search.
Google Search Console - Search analytics
You can also view image search traffic, clicks, and positions in Google Search Console. The one downfall to this is that they only provide data for the last 90 days.
- In Google Search Console click into "Search Traffic" and then "Search Analytics."
- Change the search type to "Image."
- You can then also enable impressions, CTR, and positions.
Checking the index status of your images
You can check if your images are indexed by looking at the sitemap data in Google Search Console or by using the site search operator in Google.
Google Search Console sitemap
In this example we are using WordPress and the Yoast SEO plugin to submit our sitemaps. Sitemaps aren't necessarily required if your website is setup properly, but by using them it can help you diagnosis problems with your site and dig deeper into the data.
- In Google Search Console click into "Crawl" and then "Sitemaps."
- Then click into your "Images" tab and you can see the number of images indexed out of the total submitted, within each of your sitemaps.
Google site search operator
If you aren't using sitemaps, you can also quickly jump over to Google and use a quick site search operator to find and view the images that are indexed.
To find images on your domain simply type in site:yourdomain.com
and click into "Images." You will then see all the images that are indexed. If you are checking images on a CDN you would want to type your Zone URL or if you are using a Zone Alias. But instead of using the site parameter you change to the URL parameter.
KeyCDN Zone URL Example: URL:zonename-hexid.kxcdn.com
KeyCDN Zone Alias Example: URL:cdn.keycdn.com
Proper image indexing CDN configuration
When it comes to setting up your CDN for indexing images there are a couple things you want to keep in mind, such as your if you are going to use your default Zone URL or Zone Alias (CNAME), enabling the canonical header, and your robots.txt. file.
Zone URL vs Zone Alias
You have two choices when setting up your CDN. By default when you setup a Zone with a CDN provider your assets will point to their default Zone URL such as example-hexid.kxcdn.com
. Setting up a Zone Alias allows you to point your assets to a subdomain on your own domain such as cdn.yourwebsite.com
.
You can properly index your images using both methods, but a Zone Alias has some advantages.
- If you use the Zone Alias you can use the sitemap method to view the indexed images data as we mentioned earlier. If you use the default Zone URL, you will not be able to view this data. You could still use the URL search operator.
- You have full control over it and can switch CDN providers more easily while retaining the same URLs.
- The domain name will contain keywords relevant to your site. This can make for better branding, as people will see your image URLs.
And remember, serving your images from a CDN to Google image search will always be faster than serving them from your origin server, due to having multiple POPs around the globe.
Canonical
An extra HTTP header added to your Zone lets the Google crawler know that the content from the CDN is a copy. Once we add rel="canonical"
to the HTTP header, your images will index normally as the crawler will know that they are only a copy and not duplicate content.
In KeyCDN when a new Zone is added the Canonical Header feature is automatically set to enabled
. This setting can be set to disabled
instead if you don't want this response header added.
Robots.txt file
Search engines check for a robots.txt file at the root of a site. If the file is present, they will follow the instructions but if no file is present, they will scan everything. In KeyCDN when a new Zone is added the Robots.txt feature is automatically set to disabled
. This means the robot.txt file on the origin server is applied.
If this setting is set to enabled
instead the following robots.txt file will be applied:
User-agent: *
Disallow: /
- The first line defines the crawler the rule applies to. In the example above, the robots.txt applies to every crawler.
User-agent: Googlebot
would only apply for Googlebot. - The next line defines what path can be indexed.
Disallow: /
tells the search engine to not index anything.
To customize the default value shown above you can add your own rules with the Custom Robots.txt feature.
Yoast SEO and CDN indexing
If you are using WordPress and your CDN images start to get de-indexed from your Google Search Console account, this is likely a sitemap structure issue. Assuming you are using the Yoast SEO WordPress plugin, you may need to add the following snippet at the top of your functions.php
file in order for Yoast to index your images from the CDN domain. Update the domain and your CDN URLs accordingly in the snippet below.
function wpseo_cdn_filter( $uri ) {
return str_replace( 'https://www.yoursite.com', 'https://cdn.yoursite.com', $uri );
}
add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' );
After adding this it might take a few days for your images to re-index in Google and show up in Google Search Console.
SEO your images
Now that you have learned a couple ways to configure your CDN for indexing images, there are also a few SEO tips that you always want to apply.
Apply a source attribute specifying the URL of the image.
<img src="https://www.example.com/img/blue-car.png">
Apply a width declaration (e.g.
width="200px"
).Apply a height declaration (e.g.
height="200px"
).Add an alt attribute to describe the image, which is the most important part of image SEO (e.g. a picture of a blue car would have an alt tag of
alt="blue car"
).Always use hyphens when naming your images. Google sees underscores as one word. This can seriously affect your image rankings (e.g.
blue-car.png
).Optimize your images with lossless compression so they load faster no matter where they are, your website or Google image search.
Summary
As can you can see, it is important to know how a CDN handles images so that when your dealing with Google and SEO you can make the appropriate changes and configuration so that you don't lose any traffic. This could be choosing between a default Zone URL or Zone Alias, adding canonical tags, or using the robots.txt file. And by loading your images on a CDN, besides still being indexed properly, they will also load faster, and Google loves speed.
If you have any questions regarding images and indexing them on a CDN, feel free to comment below!