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
-
Search Console Hreflang-Tag Error "missing return tag": No explanation
Hey there, we have recently implemented hreflang on the sitemap level for our global website. The website has 57 sitemaps that are all referenced in a sitemap index file (www.buschvacuum.com/sitemap.xml). Google is showing several errors in search console ("Sitemap provided URLs and alternate URLs in 'en-AU' that do not have return tags."). However when I try to verify this I do find the return tags. Can this be caused by the fact that my hreflang tags span several sitemap files? To pick one random example (see screenshot for search console error message):
International SEO | | Online-Marketing-Guy
The Originating URL-hreflang-Tag is in www.buschvacuum.com/sitemap_3.xml, the return tag is in www.buschvacuum.com/sitemap_4.xml. It would be great if someone with experience regarding those errors could help me explaining that behavior. Thanks a lot. Jochen WXYQoUH.png0 -
Are my hreflang and canonical link tags set correctly?
Currently we have a website in english but over time we will roll out parts of the whole site in different languages for different countries which will also result in country specific English versions of the website. The goal is that Google shows the country specific version of a page in a native language or English if available or falls back to the default English version of the same page otherwise. I listed below how we plan to use hreflang and canonical link tags to achieve this and was hoping to get some feedback from the Moz community if this will work as expected. (1) A page (www.mysite.com/page1) exists only in English as default. Users should be able to find it in every country unless there is an English version specifically for this country. We would use the following tags: (2) A page exists in English (www.mysite.com/id/en/page2) and Bahasa (www.mysite.com/id/id/page2) for a specific country (Indonesia in this case). Users in Indonesia searching in English should find the country specific English page. Indonesians searching in Bahasa should find the Bahasa version of that page. We would use the following tags on the English version: and therefor the following tags on the Bahasa version: In this case there wouldn't be a default English version available for the page. (3) If a page exists in English global, English for Indonesians and Bahasa for Indonesians we would use: on www.mysite.com/id/en/page3 on www.mysite.com/id/id/page3 on www.mysite.com/page3 If www.mysite.com/id/en/page3 and www.mysite.com/page3 are very similar we would risk google picking the page they want to rank for an english keyword searched in Indonesia, correct? (4) If a page in (1) and (2) can be reached with a different URL, we would only use a canonical and don't specify any hreflang tags e.g.: www.mysite.com/en/other-url-to-page1 or
International SEO | | ddspg
www.mysite.com/id/en/other-url-to-page2-english-indonesia (5) If a page that exists as global English page becomes available in English for a specific country as e.g. www.mysite.com/uk/en/page1 we would use the following tags: and also add one more hreflang to www.mysite.com/page1: The assumption here is that Google would rank the localized page instead of the global page after crawling our site again. But since this will be a new page, are we going to lose traffic because www.mysite.com/uk/en/page1 won't rank as well in the beginning (e.g. no offsite optimization)?0 -
External URLs in hreflang sitemap questions
I'm currently putting together an international sitemap for a website that has an set up like the following: example.com/us
International SEO | | Guyboz
example.com/au
example.com/ca
example.co.uk
example.se I'm planning on including the hreflang tags within sitemaps for each domain, to make sure google serves up the right version. However, I'm a bit sceptical about including the non .com domains within the .com sitemap - and the other way round for .co.uk and .se sitemaps. The way I've been doing it follows the following example: <url><loc>http://www.example.com/us/</loc></url> Putting in the .co.uk and .se domains within the .com sitemap just doesn't feel right - is this actually the right way to do it? Thanks in advance 🙂0 -
If I redirect based on IP will Google still crawl my international sites if I implement Hreflang
We are setting up several international sites. Ideally, we wouldn't set up any redirects, but if we have to (for merchandising reasons etc) I'd like to assess what the next best option would be. A secondary option could be that we implement the redirects based on IP. However, Google then wouldn't be able to access the content for all the international sites (we're setting up 6 in total) and would only index the .com site. I'm wondering whether the Hreflang annotations would still allow Google to find the International sites? If not, that's a lot of content we are not fully benefiting from. Another option could be that we treat the Googlebot user agent differently, but this would probably be considered as cloaking by the G-Man. If there are any other options, please let me know.
International SEO | | Ben.JD0 -
International websites : hreflang
Hi, i'm looking for good examples with 'href lang' tag (rel="alternate" hreflang="x") Have you examples of websites with this tag? Thanks D.
International SEO | | android_lyon0 -
Homepage and 301.
Hello. A question about the home page url. Because i'm switching my site to multiple TLDs domains. But i can't remove my language prefix path. I'm doing a: Redirect 301 / /fr in my htaccess. Does it have disadvantages for Google eye's . And a second question. If i put out there links, which url will be better, the domain , or the domain/fr Thanks.
International SEO | | jarizaro0 -
International Link Building - France, Spain, Germany, Italy, Switzerland
I've got a partner agency (non-SEO) in Europe who wants to send some additional SEO business our way, but I don't currently have a system in place geared specifically towards international, country specific link building. Does anyone know of any resources (blogs, lists, tools) specifically geared towards getting links from country specific TLDs for France, Spain, Germany, Italy and Switzerland? (.fr, .es, .de, .it and .ch are the TLDs.) .co.uk sources would also be handy. A list of potential link building sources in those countries would be most helpful. I fully understand the SEO elements in play for international SEO, I just don't have any decent resource lists for those specific countries. Sites in those countries that accept guest blog posts, language specific infographic sites, foreign PR platforms, high-quality non-penalized directories...really anything would be awesome! Thanks in advance folks!
International SEO | | Point_It0 -
Export sitemap or internal linking structure in a visual diagram?
Is there a FREE ONLINE tool that will Export a existing sitemap or internal linking structure in a visual diagram? I'm trying to help my clients see there existing sitemaps in a visual document and show how each page links to the next. Is there a FREE ONLINE tool that does this?
International SEO | | splashmedia0