Ryan .10
Ryan .10

Reputation: 11

How do I make a hreflang tag bidirectional?

Two hreflang tag examples below:

<link rel="alternate" hreflang="en" href="www.123.com/en" />
<link rel="alternate" hreflang="es" href="www.123.com/es" />

I know this will translate an English page to a Spanish page. I then need to make it bidirectional, so a Spanish page to English. How do I make it bidirectional?
I add those two tags to my English version, but where is the 'Spanish' page? Is it automatically created once I add the Spanish tag and I then go to that page to add the hreflang tag for the English version or do I add four hreflang tags (en, es and es, en) on the same page etc?

(I'm learning SEO and this is a question/topic I am confused about.)

Upvotes: 1

Views: 134

Answers (1)

Peter206
Peter206

Reputation: 112

I am not 100% sure if I understand your question correctly. I think you want to have a spanish version of your web page and an english version of it.

The google developers guide gives a recommendation in the form of the following example:

<head>
 <title>Widgets, Inc</title>
  <link rel="alternate" hreflang="en-gb"
       href="https://en-gb.example.com/page.html" />
  <link rel="alternate" hreflang="en-us"
       href="https://en-us.example.com/page.html" />
  <link rel="alternate" hreflang="en"
       href="https://en.example.com/page.html" />
  <link rel="alternate" hreflang="de"
       href="https://de.example.com/page.html" />
  <link rel="alternate" hreflang="x-default"
       href="https://www.example.com/" />
</head>

You should put the link rel tags in both html pages (both the spanish and the english version of the page)

Here is the reference to the page from which the example is taken :

localized versions of a webpage. As the absolute path is included, it will be clear which url is tied to which language.

Edit: included the recommendation from Vincent Orback's comment

Upvotes: 1

Related Questions