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. International Issues
    4. Hreflang link is always going to the homepage

    Hreflang link is always going to the homepage

    International Issues
    6 3 464
    • 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.
    • WesleySmits
      WesleySmits last edited by

      Hey there fellow Mozzers,

      I'm currently performing some work for a webshop which is located at two different TLD's.
      example.com and example.nl.

      In the head of both websites the hreflang tags have been added to tell Search Engines which site is targeted at which country. That's good ๐Ÿ™‚

      However, the hreflang links are pointing to the homepages of both websites from every page on the websites. Isn't example.nl/blog/ not supposed to link the hreflang tag to example.com/blog/?

      1 Reply Last reply Reply Quote 0
      • elementarydigital
        elementarydigital last edited by

        That's how I remember doing it so I hope so ๐Ÿ™‚ This seems to suggest so too:ย https://support.google.com/webmasters/answer/189077?hl=en

        Good luck!

        WesleySmits 1 Reply Last reply Reply Quote 2
        • WesleySmits
          WesleySmits @elementarydigital last edited by

          Thanks for the response! Do you happen to know how to properly handle this in Wordpress? Can't find a good plugin for implementing this.

          1 Reply Last reply Reply Quote 0
          • elementarydigital
            elementarydigital last edited by

            I've found this:ย http://codecanyon.net/item/hreflang-manager/6543147 but note that I haven't used it personally, so I can't comment on how good it is!

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

              Hi,

              You are correct in thinking the hreflang tag should be different on each page, pointing to the different versions of that page, not the homepage.

              Unless you feel like manually coding each page you could use php and $_SERVER['REQUEST_URI'] or js and window.location.pathname to get the current page path and append that to your domain in the hreflang tag in your head?

              Or if that seems like a lot of work you can specify your alternate URLs for each language through a sitemap like this:

              <loc>http://www.example.com/></loc>

              <xhtml:link rel="alternate" hreflang="es" href="<a href=" http:="" spanish.example.com="" "="">http://spanish.example.com/</xhtml:link>" />

              <xhtml:link rel="alternate" hreflang="en" href="<a href=" http:="" www.example.com="" "="">http://www.example.com/" /></xhtml:link>

              <xhtml:link rel="alternate" hreflang="x-default" href="<a href=" http:="" www.example.com="" "="">http://www.example.com/" /></xhtml:link>

              Thereโ€™s a good post here on the 3 different ways to implement your hreflang tags, per page, in a sitemap and in the http header here:ย http://www.branded3.com/blogs/implementing-hreflang-tag/

              Hope that helps,

              Tom

              WesleySmits 1 Reply Last reply Reply Quote 1
              • WesleySmits
                WesleySmits @TomVolpe last edited by

                Hi Tom,

                The php server request uri way would be a good option except that the URLs are different on the different domains.

                For example:

                • www.example.com/about-us/
                • www.example.nl/over-ons/

                Therefor i really need a way to define the correct url on a page by page basis. Manually doing this in Wordpress is going to be a pain. ๐Ÿ˜›

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • Internal Links Not Registering
                  lydiarosdesign
                  lydiarosdesign
                  0
                  3
                  211

                • Hreflang tags
                  davebuts
                  davebuts
                  0
                  2
                  56

                • For My International Sites only Homepage in other Language rest Pages are in English. Hreflang required here?
                  DmitriiK
                  DmitriiK
                  0
                  7
                  121

                • Recent Google Link Scheme Updated ? What's Your Reaction against Link Building, Link Exchanging ?
                  Everett
                  Everett
                  0
                  5
                  267

                • Recent Google Link Scheme Updated ? What's Your Reaction against Link Building, Link Exchanging ?
                  Chris.Menke
                  Chris.Menke
                  0
                  2
                  72

                • Linking Between Domains
                  EGOL
                  EGOL
                  0
                  4
                  214

                • Links metrics & rel="alternate" hreflang="x"
                  TommyTan
                  TommyTan
                  0
                  2
                  230

                • Footer Links
                  EwanFisher
                  EwanFisher
                  0
                  5
                  493

                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