2

I remember when making a sitemap, all URLs defined in between <loc> and </loc> must be part of the same domain as the domain the file is stored on. For example, I can use this line in my sitemap...

http://an.example.com/abc.html

...Only if the sitemap is stored on and publicly accessible from the folder mapped to the an.example.com domain.

But that entry above won't work if the sitemap is stored on a folder representing a different domain such as y.example.com or even domain.com.

My question is, should I use the above thinking when trying to index for Google images? For example, do image URLs defined in <image:loc> and </image:loc> have to contain the same domain as the location of the sitemap file the entries are contained in?

The reason why I ask is because I have two subdomains. Let's call them t.example.com and i.example.com. T is for text, and I is for images.

My site map for one page currently would look like something as follows:

<url>
<loc>http://t.example.com/page-one.html</loc>
<image:image>
<image:loc>http://i.example.com/image-one</image:loc>
<image:title>Some image</image:title>
</image:image>
</url>

Am I wrong with using a different subdomain to reference the image? Assume the sitemap file is stored and accessed at http://t.example.com/sitemap.xml

  • As far as I know, a sitemap can only contain references for the domain itself. For example, example.com cannot have a.example.com. A sitemap on a.example.com cannot have b.example.com. As far as I know, each would have to have their own sitemap. – closetnoc Jul 27 '15 at 2:36
  • ok I'll reconfigure my sitemaps to see if that helps – Mike Jul 27 '15 at 2:56
  • Let me know how it goes. – closetnoc Jul 27 '15 at 3:01
  • ok so I made the switch and due to sitemap writing rules, I included the required <loc> so now google says I submitted thousands of pages and thousands of images, but the links in <image:loc> are duplicates of <loc> just to conform to all specs. good luck me. – Mike Jul 27 '15 at 4:44
  • Ah NUTS! It may be time for a search. – closetnoc Jul 27 '15 at 4:47
1

Yes you can includes images from different domains (such as when using CDNs) if both domains are verified in your Search Console (formally Web-master tools) account, or you include an entry for the xml sitemap file in the other domains robots.txt.

More info on Image sitemaps

This is similar to including entries for URLs that reside on a different domain, which you can also do if both sites are verified in Search Console.

Simplify multiple sitemap management

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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