Mobile app version of vmapp.org
Login or Join
Reiling115

: 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

@Reiling115

Posted in: #Hreflang #RelAlternate #RelCanonical #Sitemap #XmlSitemap

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!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Reiling115

2 Comments

Sorted by latest first Latest Oldest Best

 

@Gloria169

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.

10% popularity Vote Up Vote Down


 

@Alves908

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme