The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. General questions about implementing hreflang using XML sitemap

    General questions about implementing hreflang using XML sitemap

    Technical SEO Issues
    9 2 80
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Telsenome
      Telsenome last edited by

      I created another thread regarding hreflang sitemaps. However, this one is more general and doesn't cover multiple sitemaps for different localizations so I think it's reasonable creating a new thread.

      We are trying to implement hreflang using XML sitemap. We have localized content for a few countries, but only 1/3 of the content is 'duplicate' localized content.

      How should this be presented in the sitemap? Can we have some urls with hreflang-tags and some without?

      Also, where should this be located? In the usual sitemap file at site.com/sitemap.xml or should we create a different sitemap site.com/hreflang.xml where we just paste all hreflang-info? And if it should be in /hreflang.xml - can we have the same URL twice (in both current sitemap and hreflang sitemap)?

      1 Reply Last reply Reply Quote 0
      • victor.celer
        victor.celer last edited by

        Exactly, you can add the hreflang properties for some URLs, if necessary. Examples.

        Telsenome 1 Reply Last reply Reply Quote 0
        • Telsenome
          Telsenome @victor.celer last edited by

          Thank you. Would this be the correct way of doing it?

          <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" <br="">xmlns:xhtml="http://www.w3.org/1999/xhtml"></urlset>

          <url><loc>http://www.example.com/english/page.html</loc>
          <xhtml:link rel="alternate"  hreflang="de"  href="http://www.example.com/deutsch/page.html"><xhtml:link rel="alternate" hreflang="de-ch" href="http://www.example.com/schweiz-deutsch/page.html"><xhtml:link rel="alternate" hreflang="en" href="http: www.example.com="" english="" page.html"=""></xhtml:link rel="alternate" hreflang="en" href="http:></xhtml:link></xhtml:link></url>

          <url><loc>http://www.example.com/page-with-no-translations</loc></url>

          <url><loc>http://www.example.com/page-with-no-translations2</loc></url>

          <url><loc>http://www.example.com/page-with-no-translations3</loc></url>

          <url><loc>http://www.example.com/deutsch/page.html</loc>
          <xhtml:link rel="alternate"  hreflang="de"  href="http://www.example.com/deutsch/page.html"><xhtml:link rel="alternate"  hreflang="de-ch"  href="http://www.example.com/schweiz-deutsch/page.html"><xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/english/page.html"></xhtml:link rel="alternate"></xhtml:link></xhtml:link></url>

          victor.celer 1 Reply Last reply Reply Quote 0
          • victor.celer
            victor.celer @Telsenome last edited by

            The last URL entry is a duplicate of the first one. Everything else looks fine.

            Keep in mind that this feature is Google specific. Other search engines may not understand this format.

            Telsenome 2 Replies Last reply Reply Quote 1
            • Telsenome
              Telsenome last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Telsenome
                Telsenome @victor.celer last edited by

                Thank you very much @Victor Celer. It's much appreciated that you take the time to help us out.

                1 Reply Last reply Reply Quote 1
                • Telsenome
                  Telsenome last edited by

                  Anyone that knows the answer to this? If we place all our hreflangs into a separate sitemap, /hreflang.xml - can we have the same URL in both sitemaps but it's simple in the general sitemap and contains hreflang information in the second. Like so:

                  In /sitemap.xml

                  <url><loc>http://www.example.com/english/page.html</loc></url>

                  Same url in /hreflang.xml

                  <url><loc>http://www.example.com/english/page.html</loc></url>

                  1 Reply Last reply Reply Quote 0
                  • Telsenome
                    Telsenome @victor.celer last edited by

                    Hey @Victor Celer. What do you mean by Google specific?

                    victor.celer 1 Reply Last reply Reply Quote 0
                    • victor.celer
                      victor.celer @Telsenome last edited by

                      This feature was introduced by Google. It is also supported by Yandex. The only difference I've noticed is that Yandex doen't like BOM in the sitemap encoding, while Google is OK with BOM. I'm not sure about Bing or any other search engines.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      • Hreflang in country specific XML Sitemaps?
                        zeehj
                        zeehj
                        1
                        3
                        55

                      • Search Console rejecting XML sitemap files as HTML files, despite them being XML
                        SearchDeploy
                        SearchDeploy
                        0
                        5
                        89

                      • Use hreflang language or hreflang language & country code
                        jorisbrabants
                        jorisbrabants
                        0
                        3
                        88

                      • XML Sitemap Generators
                        GPainter
                        GPainter
                        0
                        2
                        62

                      • Are mobile annotation in PC xml sitemaps a replacement for mobile xml sitemaps?
                        bridget.randolph
                        bridget.randolph
                        0
                        4
                        377

                      • Meta data & xml sitemaps for mobile sites when using rel="canonical"/rel="alternate" annotations
                        Dr-Pete
                        Dr-Pete
                        0
                        2
                        714

                      • How to generate a visual sitemap using sitemap.xml
                        Churchill1
                        Churchill1
                        0
                        3
                        8.4k

                      • Sitemap question
                        NickPateman81
                        NickPateman81
                        0
                        2
                        932

                      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
                      • Digital Marketers
                      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 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                      • Accessibility
                      • Terms of Use
                      • Privacy