Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm creating a WP plugin and I have the source URL for the image and the CDN URL to the image as well that is generated by replacing the host to the CDN host. Which is better, if I add the source URL and expose the image to the index without the CDN, or add the CDN URL and risk that it's on a different domain or the CDN subdomain is not allowed to be in the sitemap? Perhaps there is something I'm missing that is better practice.

<loc>http://mydomain.com/my-page/</loc>
<lastmod>2013-05-19T13:44:58+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
<image:image>
    <image:loc>http://mydomain.com/myimage.jpg</image:loc>
    <image:title>A title</image:title>
    <image:caption>A caption</image:caption>
</image:image>

vs

<loc>http://mydomain.com/my-page/</loc>
<lastmod>2013-05-19T13:44:58+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
<image:image>
    <image:loc>http://cdn.possiblyanotherdomain.com/myimage.jpg</image:loc>
    <image:title>A title</image:title>
    <image:caption>A caption</image:caption>
</image:image>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

I believe that Google will only follow that below to the TLD domain so subdomains such as cdn.yourdomain.com will work but a completely different domain will not. Most if not all CDN networks you can setup your domain to work in harmony with one another and should be no reason to use another domain.

Personally note:

In this day and age it's pretty pointless to include images within the sitemap, it only bloats the sitemap unnecessary. Google will never rank a image well purely based on a sitemap title or caption, it works out the image indexing based on the algorithm of the content of the page that the image it is found on and many on page factors confirm the picture contents. So when that page gets indexed so will the image.... so it's pretty pointless.

Google suggested images in sitemaps in 2009 I believe and so much has changed since then.

share|improve this answer
    
Well the images in the pages are added with JS only so it's the only way to make them get indexed. They are in the source only as links pointing to the images, but not with the img tags. –  Firsh May 20 '13 at 12:39
    
You should consider using a <noscript> alternative that why you get full weight on the image. Google can index images associated with or without pages, The major problem I see here is that if you believe Google can't make sense of your JavaScript to associate the images with the page then its likely hurting your SEO of the page, I could be wrong but I doubt that using a map to tell Google this is associated with this and that does not work, and Google will only associated content it actually can crawl on the page, as many could manipulate search results with images that are not actual embedd –  bybe May 20 '13 at 13:38
    
Makes sense. Do you think I should keep the links to the images AND add them all into the noscript tag, or just do the noscript? –  Firsh May 20 '13 at 15:46
    
Yep, so you could use <noscript><ul><li><img src="" alt=""</li><img src="" alt=""</li></ul></noscript> –  bybe May 20 '13 at 16:19
    
Yea something like that, thanks. My only problem now is that they get rewritten by Jetpack Photon. That's the scope of another question. –  Firsh May 20 '13 at 16:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.