hreflang implementation for php.net
| From: | Joost de Valk | Date: | Tue, 03 Jun 2014 21:42:57 +0000 |
| Subject: | hreflang implementation for php.net | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19172@lists.php.net to get a copy of this message | ||
Hey,
in recent days I've started noticing Google serving the wrong page for
specific functions in the search results. It served me the german and
portuguese versions of page when I was clearly searching in english with a
browser that's set to english. I think this could be helped by implementing
hreflang across php.net:
https://support.google.com/webmasters/answer/189077?hl=en
because of how the php.net structure works, I think this could actually be
quite simple for large groups of pages, for instance, this page:
http://us2.php.net/manual/en/function.version-compare.php
would have hreflang tags like this, the first one being self referencing:
<link rel="alternate" hreflang="en" href="
http://php.net/manual/en/function.version-compare.php"
/>
<link rel="alternate" hreflang="pt-BR" href="
http://php.net/manual/pt_BR/function.version-compare.php"
/>
<link rel="alternate" hreflang="es" href="
http://php.net/manual/es/function.version-compare.php"
/>
<link rel="alternate" hreflang="de" href="
http://php.net/manual/de/function.version-compare.php"
/>
(Leaving out the us2. subdomain so people would redirect to their
appropriate servers)
etc.
You could also add a redirector URL like this:
<link rel="alternate" hreflang="x-default" href="
http://php.net/manual/function.version-compare.php"
/>
Which Google would then send people to if it didn't know what the correct
language for that person is.
Would be happy to provide help / more info if needed!
Best
Joost
--
Joost de Valk
Founder & CEO, Yoast