undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. International SEO
  4. Is this setup of Hreflang xml sitemap correct?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Is this setup of Hreflang xml sitemap correct?

International SEO
3
6
4.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • SylviaH
    SylviaH last edited by Dec 9, 2015, 5:08 PM

    Hi,

    I'm trying to setup hreflang for 2 domains.  One is purely a US site and the other domain has the language-country as subdomains.

    For example:

    http://www.websiteUSA.com (Targets English - USA)

    https://www.websiteINT.com/en-CA (Targets English - Canada)

    https://www.websiteINT.com/fr-CA (Targets French - Canada)

    https://www.websiteINT/es (Targets Spanish)

    ..and so on and so forth for about 12 of these international URLs.

    I created an XML sitemap that looks something like this:

    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>http://www.websiteUSA.com</loc></url></urlset>

    <url><loc>https://www.websiteINT.com/en-CA</loc></url>

    <url><loc>https://www.websiteINT.com/fr-CA</loc></url>

    Question 1:  Is this correct?  In my actual file, I have all the countries listed and self-referencing.

    Question 2:  I'm hosting this file at https://www.websiteINT.com/hreflang.xml AND at http://www.websiteUSA.com/hreflang.xml.  Is this correct?

    Question 3:  Will this help the SERPs direct english speakers from the US to http://www.websiteUSA.com while show SERPs for say English Speakers in Canada to https://www.websiteINT.com/en-CA?

    Question 4:  For some reason, when I put up the xml site, it only listed each URL once instead of the full XML file.  Should I have uploaded a text file instead?  It doesn't seem to render correctly.

    Thank you!

    1 Reply Last reply Reply Quote 0
    • SylviaH
      SylviaH @gfiorelli1 last edited by Feb 4, 2016, 10:56 PM Feb 4, 2016, 10:56 PM

      Hi Gianluca, thanks for chiming in!

      I will look into getting this setup.  Should this solve our issue?  It seems that currently, the hreflang setup for just the home page isn't working.  Google is not showing the US site in Google US or showing the appropriate international site for Google in that specific country.

      Any other tips?  Hreflang setup for HTML will have to be applied for all pages, for all country-language sites, correct?  Where does the canonical point to?

      Lastly, if all of this is setup, do I remove country geo-targeting in Search Console?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • topic:timeago_earlier,10 days
      • gfiorelli1
        gfiorelli1 @Mobilio last edited by Jan 26, 2016, 9:37 AM Jan 26, 2016, 9:37 AM

        I personally prefer hreflang set up in HTML code, especially because is much easier to verify and correct than when it is implemented in a sitemap file.

        SylviaH 1 Reply Last reply Feb 4, 2016, 10:56 PM Reply Quote 0
        • topic:timeago_earlier,about a month
        • Mobilio
          Mobilio @SylviaH last edited by Jan 26, 2016, 9:36 AM Dec 15, 2015, 10:34 PM

          That's correct.

          Long story - there is hreflang in HTML head and in xml sitemap. What's the difference? In HTML you can use same-site or cross-site links (between domains), in XML they are only in same domain. So in XML sitemap you can't use cross-site links (between different domains).

          Also in SearchConsole you can set "international targeting" (SearchConsole -> Search Traffic -> International Targeting -> Country) for different sites.

          I know that hreflang is little bit complicated but once you setup your first site correct then on next sites will be much faster.

          gfiorelli1 1 Reply Last reply Jan 26, 2016, 9:37 AM Reply Quote 1
          • SylviaH
            SylviaH @Mobilio last edited by Dec 10, 2015, 8:03 PM Dec 10, 2015, 8:03 PM

            Hi Peter,

            Thanks for your reply!

            What you're saying is that we cannot reference different domains in the hreflang xml sitemap, is that correct?  How do I then, make sure that the english version of the International Site doesn't show up for English Speakers in the US?  Are you saying that for the US site, I only need basically one hreflang tag and no references to any other URLs?

            <url><loc>https://www.websiteUSA.com/</loc></url>

            Here's the actual XML sitemaps that don't seem to be working according to the tested sitemap in Search Console.  You can see the plain text there unless you view source code (as mentioned in Question 4).

            • For the USA Site:  http://www.shopcompex.com/hreflang-sitemap.xml
            • For the International Sites:  https://www.compexstore.com/hreflang-sitemap.xml

            Do I need to just remove the USA domain from the International sitemap and all international domains from the USA sitemap?

            I am getting an error in Search Console for both:

            | This url is not allowed for a Sitemap at this location. |

            Both referencing the different domains.

            Mobilio 1 Reply Last reply Dec 15, 2015, 10:34 PM Reply Quote 0
            • Mobilio
              Mobilio last edited by Dec 10, 2015, 1:30 AM Dec 10, 2015, 1:29 AM

              1. Look perfect. But i'm not sure that you can index in site X pages about site Y even in hreflang. You need to make test on some site. Please note - there is cross site canonical tag and this is ok. There is cross site alternate hreflang and this is ok. But i don't know about sitemap with links to other sites even in hreflang. You need to verify this in SearchConsole - upload sitemap and see for some warnings or errors there. Also don't forget that setup hreflang in HTML code too -> https://sites.google.com/site/webmasterhelpforum/en/faq-internationalisation#q16 https://moz.com/learn/seo/hreflang-tag https://moz.com/blog/hreflang-behaviour-insights

              2. Answer of this dependent from "validation" of previous question - can you setup sitemap of site X with links to site Y. IMHO you can't. So you must put sitemap about int.com to int.com site and usa.com on same site. Like your example and this is for usa.com site:
              <url><loc>https://www.websiteUSA.com/</loc></url>

              3. Yes, should be.
              "Hreflang tags may not help you increase traffic; instead, the goal of using them is to serve the right content to the right users. They help search engines swap the correct version of the page into the SERP based on a user's location and language preferences. For information on how geotargeting can help with rankings, learn about ccTLDs."
              https://moz.com/learn/seo/hreflang-tag

              4. Can you show me this? Because your sitemap may miss XSL for showing proper. Or you may return different HTTP content type.

              SylviaH 1 Reply Last reply Dec 10, 2015, 8:03 PM Reply Quote 0
              • 1 / 1
              1 out of 6
              • First post
                1/6
                Last post

              Got a burning SEO question?

              Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


              Start my free trial


              Browse Questions

              Explore more categories

              • Moz Tools

                Chat with the community about the Moz tools.

              • SEO Tactics

                Discuss the SEO process with fellow marketers

              • Community

                Discuss industry events, jobs, and news!

              • Digital Marketing

                Chat about tactics outside of SEO

              • Research & Trends

                Dive into research and trends in the search industry.

              • Support

                Connect on product support and feature requests.

              • See all categories

              Related Questions

              • moon-boots

                Multistore Sitemap

                I use Magento 2 Multistore and have 2 stores set up with identical products, one for the EU and one for the US. The best practice is to allow Google to crawl both sites, but what about the sitemap? Should I only include one store? The reason I ask is that Google has recently started ignoring canonicalized URLs, so even though the second store is canonicalized, it could affect my rank. My rank did drop with the last update when this was rolled out, I stopped some canonicalized URLs from generating and my rank went back up (albeit not as high as before).

                International SEO | Jan 3, 2020, 4:14 AM | moon-boots
                0
              • grocare

                International SEO setup issues canonical URL

                My site is www.grocare.com for one region and in.grocare.com for another region. Both of them have the same content except the currency for particular regions. Someone told me that google will take the content as duplicate and not rank either. I have setup hreflang and targeted different regions for both in the search console. I read many article which say canonical urls need to be setup for international seo sites. But Im not sure how to setup canonical urls and whether they are the right way to go . i just don't want my content deranked. Now i have setup hreflang properly after asking the moz community itself. So im hoping to get some help with this query too. TIA

                International SEO | Nov 26, 2019, 2:51 AM | grocare
                0
              • gravymatt-se

                Should Hreflang x-default be on every page of every country for an International company?

                UPDATED 4/29/2019 4:33 PM I had made to many copy and pastes. Product pages are corrected Upon researching the hreflang x-default tag, I am getting some muddy results for implementation on an international company site  older results say just homepage or the country selector but…. My Question/Direction going forward for the International Site I am working on:  I believe I can to put x-default all the pages of every country and point it to the default language page for areas that are not covered with our current sites. Is this correct? From my internet reading, the x-default on every page is not truly necessary for Google but it will be valid implemented. My current site setup example:
                https://www.bluewidgets.com Redirects to https://www.bluewidgets.com/us/en (functions as US/Global) Example Countries w/ code Site:- 4 countries/directories US/Global, France, Spain Would the code sample below be correct? https://www.bluewidgets.com/us/en/ (functions as US/Global) US/Global Country Homepage - https://www.bluewidgets.com/us/en/ US/Global Country Product Page(s) This would be for all products - https://www.bluewidgets.com/us/en/whizzer-5001/ http://www.bluewidgets.com/us/en (functions for France) France Country Homepage - https://www.bluewidgets.com/fr/fr/ France Country Product Page(s) This would be for all products- https://www.bluewidgets.com/es/es/whizzer-5001 http://www.bluewidgets.com/us/en (functions as Spain) Spain Country Homepage - https://www.bluewidgets.com/es/es/ Spain Country Product Page(s) This would be for all products - https://www.bluewidgets.com/es/es/whizzer-5001 Thanks for the spot check Gravy

                International SEO | Apr 30, 2019, 7:01 PM | gravymatt-se
                0
              • SEONOW123

                GeoIP Redirects & hreflang

                Hello, We believe we've had some issues with hreflang tags not remaining validated due to the implementation of geoIP redirects. Previously, if a user clicked a landing page on Google search that was not targeted for their territory, they would instantly be redirected to a sub path that targets their territory using geoIP redirects. We're planning to remove the initial geoIP redirects and have messaging that prompts the user to either stay on the page they've landed on, or be redirected to page that is right for their territory. However, if a user has selected to be redirected to a sub path that is targeted for their territory, they will have a cookie preference set for the IP location they've selected, and will continue to be redirected to their chosen sub path. My question is, will a crawler follow and trigger the geo preference cookie, which could potentially cause complexities in validating hreflang tags and ranking of content for the right market. Thanks.

                International SEO | Feb 16, 2018, 7:10 AM | SEONOW123
                0
              • DocdataCommerce

                How to best set up international XML site map?

                Hi everyone, I've been searching about a problem, but haven't been able to find an answer. We would like to generate a XML site map for an international web shop. This shop has one domain for Dutch visitors (.nl) and another domain for visitors of other countries (Germany, France, Belgium etc.) (.com). The website on the 2 domains looks the same, has the same template and same pages, but as it is targeted to other countries, the pages are in different languages and the urls are also in different languages (see example below for a category bags). Example Netherlands:
                Dutch domain: www.client.nl 
                Example Dutch bags category page: www.client.nl/tassen Example France:
                International domain: www.client.com 
                Example French bags category page: www.client.com/sacs When a visitor is on the Dutch domain (.nl) which shows the Dutch content, he can switch country to for example France in the country switch and then gets redirected to the other, international .com domain. Also the other way round. Now we want to generate a XML sitemap for these 2 domains. As it is the same site, but on 2 domains, development wants to make 1 sitemap, where we take the Dutch version with Dutch domain as basis and in the alternates we specify the other language versions on the other domain (see example below). <loc>http://www.client.nl/tassen</loc>
                <xhtml:link<br>rel="alternate"
                hreflang="fr"
                href="http://www.client.com/sacs"
                /></xhtml:link<br> Is this the best way to do this? Or would we need to make 2 site maps, as it are 2 domains?

                International SEO | Sep 28, 2015, 10:25 AM | DocdataCommerce
                0
              • peteboyd

                What is the proper way to setup hreflang tags on my English and Spanish site?

                I have a full English website at http://www.example.com and I have a Spanish version of the website at http://spanish.example.com but only about half of the English pages were translated and exist on the Spanish site. Should I just add a sitemap to both sites with hreflang tags that point to the correct version of the page? Is this a proper way to set this up? I was going to repeat this same process for all of the applicable URLs that exist on both versions of the website (English and Spanish). Is it okay to have hreflang="es" or do I need to have a country code attached as well? There are many Spanish speaking countries and I don't know if I need to list them all out. For example hreflang="es-bo" (Bolivia), hreflang="es-cl" (Chile), hreflang="es-co" (Columbia), etc... Sitemap example for English website URL:
                <url><loc>http://www.example.com/</loc></url> Sitemap example for Spanish website URL:
                <url><loc>http://spanish.example.com/</loc></url> Thanks in advance for your feedback and help!

                International SEO | Sep 29, 2014, 7:44 PM | peteboyd
                0
              • ALLee

                International hreflang - will this handle duplicate content?

                The title says it all - if i have duplicate content on my US and UK website, will adding the hreflang tag help google figure out that they are duplicate for a reason and avoid any penalties?

                International SEO | Jan 7, 2016, 1:15 PM | ALLee
                1
              • MartijnHoving82

                Upper case or/and lower case in rel="alternate" hreflang

                Hi Mozzers, I have a question about the rel="alternate" hreflang tag, with an example. When I use two subfolders for two different countries/languages, for instance www.domain.com/nl-nl/ and www.domain.com/nl-en/ (for the English version) and I want to use the rel="alternate" hreflang tag, do I need to follow the ISO standards concerning Uppercase country code and Lowercase language code (en-NL)? Or is it okay to use the Lowercase country and language code (en-nl), since we also use this in the URL of the Subfolder. What does Google prefer? Thanks in advance.

                International SEO | Feb 22, 2013, 9:38 PM | MartijnHoving82
                0

              Get started with Moz Pro!

              Unlock the power of advanced SEO tools and data-driven insights.

              Start my free trial
              Products
              • Moz Pro
              • Moz Local
              • Moz API
              • Moz Data
              • STAT
              • Product Updates
              Moz Solutions
              • SMB Solutions
              • Agency Solutions
              • Enterprise Solutions
              Free SEO Tools
              • Domain Authority Checker
              • Link Explorer
              • Keyword Explorer
              • Competitive Research
              • Brand Authority Checker
              • Local Citation Checker
              • MozBar Extension
              • MozCast
              Resources
              • Blog
              • SEO Learning Center
              • Help Hub
              • Beginner's Guide to SEO
              • How-to Guides
              • Moz Academy
              • API Docs
              About Moz
              • About
              • Team
              • Careers
              • Contact
              Why Moz
              • Case Studies
              • Testimonials
              Get Involved
              • Become an Affiliate
              • MozCon
              • Webinars
              • Practical Marketer Series
              • MozPod
              Connect with us

              Contact the Help team

              Join our newsletter
              Moz logo
              © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
              • Accessibility
              • Terms of Use
              • Privacy

              Looks like your connection to Moz was lost, please wait while we try to reconnect.