: Should I be using both "rel=canonical" and "rel="alternate" within my sitemap? I followed this setup in my sitemap that Google outlines on this page: https://support.google.com/webmasters/answer/189077?hl=en
I followed this setup in my sitemap that Google outlines on this page: support.google.com/webmasters/answer/189077?hl=en .
<url>
<loc>http://example.com/en</loc>
<xhtml:link rel="alternate" href="http://example.com/fr" hreflang="fr" />
<xhtml:link rel="alternate" href="http://example.com/de" hreflang="de" />
<xhtml:link rel="alternate" href="http://example.com/es" hreflang="es" />
<xhtml:link rel="alternate" href="http://example.com/en" hreflang="x-default" />
</url>
<url>
<loc>http://example.com/fr</loc>
<xhtml:link rel="alternate" href="http://example.com/fr" hreflang="fr" />
<xhtml:link rel="alternate" href="http://example.com/de" hreflang="de" />
<xhtml:link rel="alternate" href="http://example.com/es" hreflang="es" />
<xhtml:link rel="alternate" href="http://example.com/en" hreflang="x-default" />
</url>
However, should I also be including a "rel=canonical" tag like the following?
<url>
<loc>http://example.com/en</loc>
<xhtml:link rel="alternate" href="http://example.com/fr" hreflang="fr" />
<xhtml:link rel="alternate" href="http://example.com/de" hreflang="de" />
<xhtml:link rel="alternate" href="http://example.com/es" hreflang="es" />
<xhtml:link rel="alternate" href="http://example.com/en" hreflang="x-default" />
<xhtml:link rel="canonical" href="http://example.com/en" />
</url>
<url>
<loc>http://example.com/fr</loc>
<xhtml:link rel="alternate" href="http://example.com/fr" hreflang="fr" />
<xhtml:link rel="alternate" href="http://example.com/de" hreflang="de" />
<xhtml:link rel="alternate" href="http://example.com/es" hreflang="es" />
<xhtml:link rel="alternate" href="http://example.com/en" hreflang="x-default" />
<xhtml:link rel="canonical" href="http://example.com/fr" />
</url>
Thank you!
More posts by @Reiling115
2 Comments
Sorted by latest first Latest Oldest Best
It is always best to have a "rel=canonical" in the <head> of the HTML code in each page that you want the site crawled as. This means that if you are using a a separate site for desktop and mobile, and both pages point to the same content, always have the canonical link point to the address that you want the search engine to recognize and crawl. ie. example.org & m.example.org should both have a:<link rel="canonical" href="http://www.example.org/"> in the <head> of each page.
The same would be for example.org/music.html & m.example.org/music.htm
Each page should have a canonical link:
<link rel="canonical" href="http://www.example.org/music">
Search engine are well known to skip over sitemaps that have not been recently changed. That is why most are overlooking the <lastmod> and <changefreq> setting. They are basically saying, "I have this information, why do I want to see it again?" A sitemap is relevant, but your pages are priority.
To place the canonical link in both the HTML code and sitemap is overkill.
The canonical and alternate tags IMHO should be used in the HTML of a page.
The sitemap should only contain the URLs that you want indexed.
So the sitemap should look like this:
<url>
<loc>http://example.com/en</loc>
</url>
All other URLs should not be included in the sitemap.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.