Are hreflangs needed in the XML sitemap if they are used in the head of each page?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have a multi-language website like this:
example.com/de/about
example.com/fr/about
example.com/about (English)
I decided to put the hreflang link elements in the <head>
of each file.
Now I wonder, is it enough to only put the default English URL in the sitemap like this:
<url>
<loc>example.com/about</loc>
</url>
or do I have to put every language version in the sitemap:
<url>
<loc>example.com/de/about</loc>
</url>
<url>
<loc>example.com/fr/about</loc>
</url>
<url>
<loc>example.com/about</loc>
</url>
seo xml-sitemap multilingual hreflang
add a comment |Â
up vote
1
down vote
favorite
I have a multi-language website like this:
example.com/de/about
example.com/fr/about
example.com/about (English)
I decided to put the hreflang link elements in the <head>
of each file.
Now I wonder, is it enough to only put the default English URL in the sitemap like this:
<url>
<loc>example.com/about</loc>
</url>
or do I have to put every language version in the sitemap:
<url>
<loc>example.com/de/about</loc>
</url>
<url>
<loc>example.com/fr/about</loc>
</url>
<url>
<loc>example.com/about</loc>
</url>
seo xml-sitemap multilingual hreflang
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a multi-language website like this:
example.com/de/about
example.com/fr/about
example.com/about (English)
I decided to put the hreflang link elements in the <head>
of each file.
Now I wonder, is it enough to only put the default English URL in the sitemap like this:
<url>
<loc>example.com/about</loc>
</url>
or do I have to put every language version in the sitemap:
<url>
<loc>example.com/de/about</loc>
</url>
<url>
<loc>example.com/fr/about</loc>
</url>
<url>
<loc>example.com/about</loc>
</url>
seo xml-sitemap multilingual hreflang
I have a multi-language website like this:
example.com/de/about
example.com/fr/about
example.com/about (English)
I decided to put the hreflang link elements in the <head>
of each file.
Now I wonder, is it enough to only put the default English URL in the sitemap like this:
<url>
<loc>example.com/about</loc>
</url>
or do I have to put every language version in the sitemap:
<url>
<loc>example.com/de/about</loc>
</url>
<url>
<loc>example.com/fr/about</loc>
</url>
<url>
<loc>example.com/about</loc>
</url>
seo xml-sitemap multilingual hreflang
seo xml-sitemap multilingual hreflang
edited 25 mins ago


Stephen Ostermiller♦
65.2k1388236
65.2k1388236
asked 4 hours ago
Adam
1676
1676
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Wherever you put the hreflang is fine you have to use only one of the above methods. Find the methods suggested by Google here: Tell Google about localized versions of your page
Methods for indicating your alternate pages There are three ways to indicate multiple language/locale versions of a page to Google:
- HTML Tags
- HTTP Headers
- Sitemap
From personal experience i would suggest using the head method
Sitemap:
Pros:
More control over which pages have alternative language
Easy setup (crawl and set)
Cons:
Monthly Update
Head:
Pros:
Process can be automate by variety of plugins and scripts out there
Cons:
You can end up easily have hreflang issues on pages without alternative language (unless is done manually ignore this)
Note: Im not really sure what happens if you keep both but i find that unnecessary, keep it simple and healthy to avoid errors and eventually google ignoring your hreflang.
So if use the head method you would not put<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?
– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put<loc>example.com/about</loc>
in the sitemap and there is no need to put<loc>example.com/fr/about</loc>
and<loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.
– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
add a comment |Â
up vote
0
down vote
You have to specify each language specific url in your sitemap. Google has a post on its webmasters page that you can check. It has a specific section dedicated to sitemaps and localized versions of your site with a detailed example. In that section it reads:
You can use a Sitemap to tell Google all of the language and region
variants for each URL. To do so, add a element specifying a
single URL, with child entries listing every
language/locale variant of the page including itself. Therefore if you
have 3 versions of a page, your sitemap will have 3 entries, each with
3 identical child entries.
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the<head>
of each file.
– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Wherever you put the hreflang is fine you have to use only one of the above methods. Find the methods suggested by Google here: Tell Google about localized versions of your page
Methods for indicating your alternate pages There are three ways to indicate multiple language/locale versions of a page to Google:
- HTML Tags
- HTTP Headers
- Sitemap
From personal experience i would suggest using the head method
Sitemap:
Pros:
More control over which pages have alternative language
Easy setup (crawl and set)
Cons:
Monthly Update
Head:
Pros:
Process can be automate by variety of plugins and scripts out there
Cons:
You can end up easily have hreflang issues on pages without alternative language (unless is done manually ignore this)
Note: Im not really sure what happens if you keep both but i find that unnecessary, keep it simple and healthy to avoid errors and eventually google ignoring your hreflang.
So if use the head method you would not put<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?
– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put<loc>example.com/about</loc>
in the sitemap and there is no need to put<loc>example.com/fr/about</loc>
and<loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.
– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
add a comment |Â
up vote
2
down vote
accepted
Wherever you put the hreflang is fine you have to use only one of the above methods. Find the methods suggested by Google here: Tell Google about localized versions of your page
Methods for indicating your alternate pages There are three ways to indicate multiple language/locale versions of a page to Google:
- HTML Tags
- HTTP Headers
- Sitemap
From personal experience i would suggest using the head method
Sitemap:
Pros:
More control over which pages have alternative language
Easy setup (crawl and set)
Cons:
Monthly Update
Head:
Pros:
Process can be automate by variety of plugins and scripts out there
Cons:
You can end up easily have hreflang issues on pages without alternative language (unless is done manually ignore this)
Note: Im not really sure what happens if you keep both but i find that unnecessary, keep it simple and healthy to avoid errors and eventually google ignoring your hreflang.
So if use the head method you would not put<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?
– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put<loc>example.com/about</loc>
in the sitemap and there is no need to put<loc>example.com/fr/about</loc>
and<loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.
– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Wherever you put the hreflang is fine you have to use only one of the above methods. Find the methods suggested by Google here: Tell Google about localized versions of your page
Methods for indicating your alternate pages There are three ways to indicate multiple language/locale versions of a page to Google:
- HTML Tags
- HTTP Headers
- Sitemap
From personal experience i would suggest using the head method
Sitemap:
Pros:
More control over which pages have alternative language
Easy setup (crawl and set)
Cons:
Monthly Update
Head:
Pros:
Process can be automate by variety of plugins and scripts out there
Cons:
You can end up easily have hreflang issues on pages without alternative language (unless is done manually ignore this)
Note: Im not really sure what happens if you keep both but i find that unnecessary, keep it simple and healthy to avoid errors and eventually google ignoring your hreflang.
Wherever you put the hreflang is fine you have to use only one of the above methods. Find the methods suggested by Google here: Tell Google about localized versions of your page
Methods for indicating your alternate pages There are three ways to indicate multiple language/locale versions of a page to Google:
- HTML Tags
- HTTP Headers
- Sitemap
From personal experience i would suggest using the head method
Sitemap:
Pros:
More control over which pages have alternative language
Easy setup (crawl and set)
Cons:
Monthly Update
Head:
Pros:
Process can be automate by variety of plugins and scripts out there
Cons:
You can end up easily have hreflang issues on pages without alternative language (unless is done manually ignore this)
Note: Im not really sure what happens if you keep both but i find that unnecessary, keep it simple and healthy to avoid errors and eventually google ignoring your hreflang.
answered 2 hours ago


John Could
3025
3025
So if use the head method you would not put<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?
– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put<loc>example.com/about</loc>
in the sitemap and there is no need to put<loc>example.com/fr/about</loc>
and<loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.
– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
add a comment |Â
So if use the head method you would not put<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?
– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put<loc>example.com/about</loc>
in the sitemap and there is no need to put<loc>example.com/fr/about</loc>
and<loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.
– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
So if use the head method you would not put
<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?– Adam
2 hours ago
So if use the head method you would not put
<loc>example.com/fr/about</loc>
into the sitemap? So you basically saying the opposite as ΣÀÃÂÃÂο ΓοÃÂλα :D?– Adam
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
No, <loc> is a required tag for sitemaps you have to include that i may misunderstand your question sorry is morning over here :) If you are asking which version to include in <loc> then you must include your desired version it doesnt really make any difference i personally usually use the "en" or "x-default" - When Google is going through a website it visits first the robots.txt (where sitemap is declared) so it will return the correct hreflang no matter what you include in <loc>
– John Could
2 hours ago
Yeah sorry was unclear. What I meant is, you say its enough to put
<loc>example.com/about</loc>
in the sitemap and there is no need to put <loc>example.com/fr/about</loc>
and <loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.– Adam
1 hour ago
Yeah sorry was unclear. What I meant is, you say its enough to put
<loc>example.com/about</loc>
in the sitemap and there is no need to put <loc>example.com/fr/about</loc>
and <loc>example.com/about</loc>
together in the sidemap -right? This would be the opposite of what ΣÀÃÂÃÂο ΓοÃÂλα said.– Adam
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
Exactly if you dont use the sitemap to declare your alternative language then just put this: <loc>example.com/about</loc>
– John Could
1 hour ago
add a comment |Â
up vote
0
down vote
You have to specify each language specific url in your sitemap. Google has a post on its webmasters page that you can check. It has a specific section dedicated to sitemaps and localized versions of your site with a detailed example. In that section it reads:
You can use a Sitemap to tell Google all of the language and region
variants for each URL. To do so, add a element specifying a
single URL, with child entries listing every
language/locale variant of the page including itself. Therefore if you
have 3 versions of a page, your sitemap will have 3 entries, each with
3 identical child entries.
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the<head>
of each file.
– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
add a comment |Â
up vote
0
down vote
You have to specify each language specific url in your sitemap. Google has a post on its webmasters page that you can check. It has a specific section dedicated to sitemaps and localized versions of your site with a detailed example. In that section it reads:
You can use a Sitemap to tell Google all of the language and region
variants for each URL. To do so, add a element specifying a
single URL, with child entries listing every
language/locale variant of the page including itself. Therefore if you
have 3 versions of a page, your sitemap will have 3 entries, each with
3 identical child entries.
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the<head>
of each file.
– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You have to specify each language specific url in your sitemap. Google has a post on its webmasters page that you can check. It has a specific section dedicated to sitemaps and localized versions of your site with a detailed example. In that section it reads:
You can use a Sitemap to tell Google all of the language and region
variants for each URL. To do so, add a element specifying a
single URL, with child entries listing every
language/locale variant of the page including itself. Therefore if you
have 3 versions of a page, your sitemap will have 3 entries, each with
3 identical child entries.
You have to specify each language specific url in your sitemap. Google has a post on its webmasters page that you can check. It has a specific section dedicated to sitemaps and localized versions of your site with a detailed example. In that section it reads:
You can use a Sitemap to tell Google all of the language and region
variants for each URL. To do so, add a element specifying a
single URL, with child entries listing every
language/locale variant of the page including itself. Therefore if you
have 3 versions of a page, your sitemap will have 3 entries, each with
3 identical child entries.
answered 4 hours ago


ΣÀÃÂÃÂο ΓοÃÂλαÂ
4807
4807
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the<head>
of each file.
– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
add a comment |Â
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the<head>
of each file.
– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the
<head>
of each file.– Adam
4 hours ago
Thanks for your answer! Actually I was reading the same article and they say If you have multiple versions of a page for different languages or regions, tell Google about these different variations. [...] There are three ways to indicate multiple language/locale versions of a page to Google:. This is why I think it might be redundant to put language specific URL in sitemap and in the
<head>
of each file.– Adam
4 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
@Adam Indication apart, your sitemap should have all of your site's urls in it. Even when you don't need to specify localized content because you already do so in other ways, having all the different urls can be proven useful in scenarios like finding: actual number of site pages, crawling errors for different pages, number of indexed pages etc. In the end, specifying localized content in your sitemap is a "nice to have" even if you have already accomplished your goal of indicating localized content through other means.
– Î£Ã€ÃÂÃÂο ΓοÃÂλαÂ
3 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwebmasters.stackexchange.com%2fquestions%2f118633%2fare-hreflangs-needed-in-the-xml-sitemap-if-they-are-used-in-the-head-of-each-pag%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password