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: 104
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

The hreflang tag

Post by filmphotog » Sat Dec 19, 2015 9:43 am

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: 20593
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: The hreflang tag

Post by Pablo » Sat Dec 19, 2015 12:42 pm

I'm sorry I am not familiar with the hreflang tag.

filmphotog
 
 
Posts: 104
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog » Sat Dec 19, 2015 1:29 pm

Thanks. The hreflang tag is probably not used for a single language site.

filmphotog
 
 
Posts: 104
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog » Tue Dec 29, 2015 1:43 pm

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: 104
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog » Wed Mar 02, 2016 7:51 am

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: 104
Joined: Sat Sep 05, 2015 7:20 am
Location: Sweden
Contact:

Re: The hreflang tag

Post by filmphotog » Wed Mar 02, 2016 9:55 am

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