The hreflang tag

Do you want to share WYSIWYG Web Builder tips, tricks, tutorials or useful HTML code? You can post it here...
(no questions or problems please, this section is not monitored by support).
Forum rules
This section is to share tips, tricks and tutorials related to WYSIWYG Web Builder.
Please do not post questions or problems here. They will not be answered.

PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
Post Reply
filmphotog
 
 
Posts: 87
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

The hreflang tag

Post by filmphotog »

I have a website where all pages have two languages. For every pair of pages I have this between the head tags:

Code: Select all

<link rel="alternate" href="http://mywebsite.com" hreflang="en">
<link rel="alternate" href="http://mywebsite.com/sv" hreflang="sv">
This connects pages with the same content in two languages (sub-pages have their own urls).

--

The question is for websites in just English, the webmaster tools complains "Your site has no hreflang tags". Is it possible to set this tag for one language sites?

Thanks :)
User avatar
Pablo
 
Posts: 21569
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: The hreflang tag

Post by Pablo »

I'm sorry I am not familiar with the hreflang tag.
filmphotog
 
 
Posts: 87
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog »

Thanks. The hreflang tag is probably not used for a single language site.
filmphotog
 
 
Posts: 87
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog »

Just a tip: The host may automatically change the link mywebsite.com/sv into this mywebsite.com/sv/ with the ending slash. Then the code should have the slash or a search engine can't find the pages.
filmphotog
 
 
Posts: 87
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog »

Here are more useful reading material on the hreflang topic, and a testing tool: http://hreflang.org/

And to answer my original question above the hreflang tag is only useful two or more languages. It can also be used for targeting different regions (for example en-AU and en-CA) but if all English pages has the same content Google may decide to show just one version in search.
filmphotog
 
 
Posts: 87
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog »

Additional info,

- For a generic .com site in English with a Spanish language .com/es/ alternative, only a single link on each page to the alternative should be enough (self-referencing is not necessary). It's ok to have two hreflang tags like my example above though.

- For multiple language sites all sets of hreflang tags should be the same on the pages, including self-referencing.

Reference doc: https://support.google.com/webmasters/a ... 9077?hl=en
Post Reply