Are hreflangs needed in the XML sitemap if they are used in the head of each page?

The name of the pictureThe name of the pictureThe name of the pictureClash 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>









share|improve this question





























    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>









    share|improve this question

























      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>









      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 25 mins ago









      Stephen Ostermiller♦

      65.2k1388236




      65.2k1388236










      asked 4 hours ago









      Adam

      1676




      1676




















          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:



          1. HTML Tags

          2. HTTP Headers

          3. 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.






          share|improve this answer




















          • 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


















          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.







          share|improve this answer




















          • 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











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "45"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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:



          1. HTML Tags

          2. HTTP Headers

          3. 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.






          share|improve this answer




















          • 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















          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:



          1. HTML Tags

          2. HTTP Headers

          3. 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.






          share|improve this answer




















          • 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













          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:



          1. HTML Tags

          2. HTTP Headers

          3. 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.






          share|improve this answer












          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:



          1. HTML Tags

          2. HTTP Headers

          3. 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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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













          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.







          share|improve this answer




















          • 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















          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.







          share|improve this answer




















          • 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













          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.







          share|improve this answer












          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.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery