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!
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 vs canonical
I'm having an international Drupal website and the hreflang module is in use. However, I'm still not sure how to optimize the pages. Perhaps it's easier to ask with an example **International: **www.example.com/products/product1
International SEO | | Teklan
Here we have the master content of the product **US: **www.example.com/us/products/product1
Here we have exactly the same content as international. Nothing is localized. **UK: **www.example.com/uk/products/product1
Here we have almost the same content as on International. Here and there some local terms and extra text. **German: **www.example.com/de/products/product1
Here we have a translated version of the international page. Questions Do I add hreflang from all to all pages + to itself? Where do I add canonicals? How should I optimize the content on the US and UK pages?0 -
Google Webmaster showing error for [hreflang='x-default']
Hi There! Using [hreflang='x-default'] tag to target language specific countries on our site but Google Webmaster showing errors even implementation made as per Google guideline but one thing is not clear and we are not sure, this is the reason behind it. Error is showing up only on those pages where 'Google Parameters' are used. For example : https://www.sitegeek.com/a2hosting?grank=open 'grank=' is defined as a 'Google Parameters' and on the above page 'hreflang' tags are : Also, on page https://www.sitegeek.com/a2hosting [without Google Parameters] same above 'hreflang' tags are taken. But, There is no error on second page URL where no 'Google Parameters' in URL. Therefore, error showing on first URL where 'Google Parameters' are taken. Is this the issue or not? suggest how to remove? -- Rajiv S9vhl3T
International SEO | | gamesecure0 -
Can multiple hreflang tags point to one URL? International SEO question
Moz, Hi Moz, Can multiple hreflang tags point to a single URL? For example, if I have a Canadian site (www.example.com/ca) that targets French and English speakers can I have the following: or would I use: Any insight would be very helpful and greatly appreciated! Thank you in advance!
International SEO | | DA20131 -
Homepage URL for multi-language site
Hi, We are setting up a new site, and currently considering the URL and folder structure of the site. We will have 2-3 different language versions, and we have decided to use sub folders for this. My question is regarding the homepage URL. We want the English language site (en) to be the default one, from where you can then change the language. Should I have a folder for each of the language versions (as described below)? www.mydomain.com/en
International SEO | | Awaraman
(this would be the default page where everyone would always come if they type www.mydomain.com to webrowser) www,mydomain.com/ru www.mydomain.com/es Or, would it be better for SEO to have www.mydomain.com as the default URL where we would have the English version of the site, and then have two other folders (as below) where we would have the 2 other language versions: www,mydomain.com/ru www.mydomain.com/es Thank you in advance, BR Sam0 -
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 -
Correct Hreflang & Canonical Implementation for Multilingual Site
OK, 2 primary questions for a multilingual site. This specific site has 2 language so I'll use that for the examples. 1 - Self-Referencing Hreflang Tag Necessary? The first is regarding the correct implementation of hreflang, and whether or not I should have a self-referencing hreflang tag. In other words, if I am looking at the source code for http://www.example.com/es/ (our Spanish subfolder), I am uncertain whether the source code should contain the second line below: Obviously the Spanish version should reference the English version, but does it need to reference itself? I have seen both versions implemented, with seemingly good results, but I want to know the best practice if it exists. 2 - Canonical of Current Language or Default Language? The second questions is regarding which canonical to use on the secondary language pages. I am aware of the update to the Google Webmaster Guidelines recently that state not to use canonical, but they say not to do it because everyone was messing it up, not because it shouldn't be done. So, in other words, if I am looking at the source code for http://www.example.com/es/ (our Spanish subfolder), which of the two following canonicals is correct? OR For this question, you can assume that (A) the English version of the site is our default and (B) the content is identical. Thanks guys, feel free to ask any qualifiers you think are relevant.
International SEO | | KaneJamison1 -
I need suggestions. We're helping a big journal to improve their external links, even though they've a site with over 10 million monthly visits, their external links are week. Any suggestions?
Please let us know where we can find information on how to improve external links for a very big journal site. Thanks.
International SEO | | carloscontinua0 -
International Link Building
Can anyone weigh in on their own efforts to build links into international TLDs? Which tactics have been successful? Which have failed? Have you engaged any agencies to manage this for you and if so, how did they perform and who are they? We have nine ccTLDs plus our .com site to manage so it's a bit overwhelming! Fortunately, we have teams dedicated to managing day-to-day operations of each site. Each team is comprised of managers who speak the targeted language as their first language and have intimate knowledge of the targeted culture. I want to leverage them to help my SEO efforts, but I'm not sure how my advice should be different than what we do for our .com site.
International SEO | | RyanOD0