1

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.)

Michael M.
  • 10,486
  • 9
  • 18
  • 34
Ryan .10
  • 11
  • 1
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 24 '22 at 19:17

1 Answers1

1

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

Peter206
  • 114
  • 1
  • 8
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/33544298) – Vincent Orback Jan 03 '23 at 12:57