
Take a look at an image index issue in above image. Here is second screenshot.
Nearly zero(0) images indexed before and somehow I missed it for so many months and trust me that’s not a good feeling. It’s also bad for the blog. I would say it’s a major CDN SEO impact.
In addition to below questions do you also have MaxCDN and image index issue? I would say then you are at right place.
- Zero image indexed in Google Search console?
- Want to have better image SEO with rel=”canonical”?
- Want Google To Index Your Website Images When Using CDN?
- Want to Setup MaxCDN with WordPress Blog Without Duplicate Issue?
- SEO CDN, SEO sitemap, MaxCDN and WordPress image issue??
- Does a CDN affect search rankings?
Please follow all below mentioned critical steps carefully to fix image index issue in Google Search Console.
But why Google Penalty?
- With CDN, your site URLs loads over CDN URLs.
- https://cdn.crunchify.com/wp-content/uploads/2016/05/Go-to-SEO-tab-at-MaxCDN-and-enable-Canonical-Header.png
- When you generate your sitemap.xml or sitemap_index.xml and submit to google via Search Console then it has all image URLs
without CDN:- https://crunchify.com/wp-content/uploads/2016/05/Go-to-SEO-tab-at-MaxCDN-and-enable-Canonical-Header.png
- Google finds those are duplicate contents and start removing those URLs from the index.
What are we going to do?
- We will fix
sitemap_index.xmlfile - Replace image URL from
crunchify.comtocdn.crunchify.com - We will perform all below settings including
rel="canonical"URL setting
Let’s get started:
Step-1
Since last 4 years, I’ve been running my WordPress site Crunchify with 4 different CDN custom domains (CNAMEs).
- cdn.crunchify.com
- cdn1.crunchify.com
- cdn2.crunchify.com
- cdn3.crunchify.com
In order to fix this image SEO issue, it was essential to have unique URL for all my images. That’s the reason I got rid off all except cdn.crunchify.com custom domain.
The reason I’ve added more custom domains before is to make sure that browser loads all resources in parallel with different domains. If it’s a single domain then request will be piled up and may increase page load time.
It’s been over two weeks and I haven’t seen any slow site performance because of just one custom domain cdn.crunchify.com.
All latest browsers are equipped with downloading resources in parallel and you shouldn’t even worry about having more custom CDN domains.

Step-2
- Go to
SEO tabat MaxCDN and enableCanonical Headercheckbox. - You
don'thave to enablerobots.txtfile.

- Above setting will add
rel="canonical"on all images loaded on your site. Take a look at below HTML Header element.

Step-3
Add and verify your custom domain to Google Search Console (Webmaster tools). i.e. cdn.crunchify.com.

Step-4
NOTE: Below step is only for folks who is using WordPress Yoast SEO plugin.
By default, Yoast SEO plugin creates image URL with honoring CDN URL. We are going to change it to point to CDN. Open your WordPress theme’s functions.php file and add below code into it.
function crunchify_maxcdn_image_seo_fix( $uri ) {
return str_replace( 'https://crunchify.com', 'https://cdn.crunchify.com', $uri );
}
add_filter( 'wpseo_xml_sitemap_img_src', 'crunchify_maxcdn_image_seo_fix' );
Basically – we are just replacing
https://crunchify.comwithhttps://cdn.crunchify.com
Step-5 Disable and Enable Sitemap
- Go to SEO -> XML Sitemap Tab of Yoast SEO plugin
- Click on
DisabledXML sitemap functionality selector - Click
Save - Click on Enabled XML sitemap functionality selector
- Click
Saveagain - This will regenerate sitemap_index.xml file
Step-6
Visit your sitemap URL. Here is a sample:
- Visit https://crunchify.com/sitemap_index.xml
- Select
post-sitemap.xml: https://crunchify.com/post-sitemap.xml Right clickon page and clickView Page Source- Look for <image:image> tag and see difference below
Before:

After:

That’s it. Now in sitemap and on your blog – you have image loading from CDN URLs 🙂 No content duplication issue. Would like to mention my friend Brian at KeyCDN whose article I saw first and inspired me to make above changes.
Please wait now for a week or so and you should see your images will be getting indexed by Google again as you see in the 1st image on the top of this page. If you have any better suggestion then let us know.
Update: Finally after 2 weeks, it seems almost all images are indexed again.

Just FYI 🙂
cdn.crunchify.com and crunchify.com both loads same page. As CDN link has canonical HTML Tag setup correctly there isn’t any duplication you should see in Google Search Result Page.

