Hreflang link is always going to the homepage
-
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/?
-
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:
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.
-
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="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
-
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!
-
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.
-
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!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
Hreflang alternate as single-hop 301 - is this actually a problem?
First, this is not a question about whether 301 redirects pass page rank. My question is that if your hreflang alternative page URL is a 301 redirect*, are there any downsides. In all cases with our situation, the 301 redirect is single-hop and working. Tools, such as SEMRush seem to flag this as a non-canonical hreflang error, but I'm not able to find any cases where Google has suggested a redirecting hreflang is a problem. I'd appreciate any information on this issue before we invest extra time on a large international site. *In Drupal, there are scenarios where it's all but impossible to avoid having a 301 redirect in your hreflang alternate URL without significant custom work.
International SEO | | scottclark0 -
Hreflang on non 1:1 websites
Hi. I have a client with international websites targeting several different countries. Currently, the US (.com) website outranks the country-specific domain when conducting a search within that country (i.e. US outranks the UK website in the UK). This sounds like a classic case for hrelang. However, the websites are largely not 1:1. They offer different content with a different design and a different URL structure. Each country is on a country-specific domain (.com, .co.uk, .com.au, etc.). As well, the country-specific domains have lower domain authority than the US/.com website - fewer links, lower quality content, poorer UX, etc. Would hreflang still help in this scenario if we were to map it the closest possible matching page? Do the websites not sharing content 1:1 add any risks? The client is worried the US/.com website will lose ranking in the country but the country-specific domain won't gain that ranking. Thanks for any help or examples you can offer!
International SEO | | Matthew_Edgar0 -
Hreflang tags
I know these are intended for specifying different language/regional versions of one site, but can they be used to specify just ONE country (eg. "en-au")? Or does it only work to specify an ALTERNATIVE to another language/region variation?
International SEO | | muzzmoz0 -
Worldwide and Europe hreflang implementation.
Hi Moz ! We're having quite a discussion here and I'd like to have some inputs. Let me explain the situation and what we plan to do so far. One of our client has two separate markets : World and Europe. Both pages versions will be mostly the same, except for the fact that they will have their own products. So basically, we'd want to show only the European EN version to Europe and the standard EN version to the rest of the world, same goes for FR and ES. As far as IT, DE, CS and SK, they will only be present within the european version. Since we cannot target all Europe with a single hreflang tag, we might have to do it for every single european countries. Regarding this subject, SMX Munich recently had quite an interesting session about this topic with a confirmation coming from John Mueller saying that we can target a single URL more than once with different hreflang tags. You can read more here : http://www.rebelytics.com/multiple-hreflang-tags-one-url/ So having all this in mind, here's the implementation we plan to do : www.example.com/en/ Self canonical www.example.com/fr/ - hreflang = fr www.example.com/es/ - hreflang = es www.example.eu/it/ - hreflang = it www.example.eu/de/ - hreflang = de www.example.eu/cs/ - hreflang = cs www.example.eu/sk/ - hreflang = sk www.example.eu/fr/ - hreflang = be-fr www.example.eu/fr/ - hreflang = ch-fr www.example.eu/fr/ - hreflang = cz-fr www.example.eu/fr/ - hreflang = de-fr www.example.eu/fr/ - hreflang = es-fr www.example.eu/fr/ - hreflang = fr-fr www.example.eu/fr/ - hreflang = uk-fr www.example.eu/fr/ - hreflang = gr-fr www.example.eu/fr/ - hreflang = hr-fr etc… . This will be done for all european countries (FR, EN and ES). www.example.com/en/ - x-default Let me know what you guys think. Thanks!
International SEO | | Netleaf.ca0 -
Linking .com and .co.uk
My client has an online ecommerce store which he is due to launch later this week. He owns both the .co.uk and the .com - the site is hosted on .co.uk and the .com domain redirects to the .co.uk The client wants anyone who visits the site from the .com to see permalinks when later going through the site as .com as opposed to .co.uk permalinks. Is this possible/any suggestions? Thank you!
International SEO | | jamiericey0 -
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:
International SEO | | peteboyd
<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!0 -
Auto-Redirecting Homepage on Multilingual Site
The website has an auto-redirecting homepage on a multilingual site. Here is some background: User visits the site for first time > sent to javascript age verification page with country of origin selector. If selects "France" then served French page (.com/fr-fr/). If selects any other country, then served English page (.com/en-int/). A cookie is set, and next time the user visits the site, they are automatically served the appropriate language URL. 1st Question: .com/ essentially does not exist. It is being redirected to .com/en-int/ as this is the default page. Should this be a 301 redirect since I want this to serve as the new homepage? 2nd Question:. In the multilingual sitemap, should I still set .com/ as the hreflang="x-default" even though the user is automatically redirected to a language directory? According to Google, as just released here: http://googlewebmastercentral.blogspot.com/2014/05/creating-right-homepage-for-your.html "automatically serve the appropriate HTML content to your users depending on their location and language settings. You will either do that by using server-side 302 redirects or by dynamically serving the right HTML content. Remember to use x-default rel-alternate-hreflang annotation on the homepage / generic page even if the latter is a redirect page that is not accessible directly for users." So, this is where I am not clear. If use a 302 redirect of .com/ to either .com/en-int/ or .com/fr-fr/, won't I then lose the inbound link value and DA/PA of .com/ if I just use a 302? Note: there is no .com/ at this moment. Any advice is appreciated. Thanks,Alex
International SEO | | Alex.Weintraub0 -
Which hreflang tag to use for .eu domain
Hi there, We're trying to solve a problem with one of our domains, we have a .eu CCTLD and we're trying to implement hreflang tags. On our US and UK sites, we use "en-us" and "en-gb", but it's not clear how to approach this european problem, as there is not a "en-eu" tag. The site is in English, but serves several European countries speaking different languages. What's the best hreflang code to use in this situation? Any help much appreciated, Thanks!
International SEO | | dennis.globalsign0