WPML Incorrect hreflang implementation Translated Page Pointing at Wrong URL

Recently I was working with a domain which is configured for multiple languages. I was using my favorite theme which I use right here, U-Design. U-design is easily the most well documented, maintained and supported theme I have found to date and fully compatible with large plugins such as WPML and WooCommerce.

Incorrect hreflang implementation

I noticed this error in Google Search Console. For the site I was working with, this was very low priority. The error did not seem to adversely affect rankings for the English or the Spanish page.

WPML Problem

I have notified WPML of the issue.

The issue I was having is the Spanish page had an hreflang tag to a URL of what the home page would be if it weren’t the home page.

For example:

  • domain.com/es/ – the Spanish page
  • domain.com/ – the Home page
  • domain.com/home/ – the page the Spanish page kept linking to

In a perfect world the code on the /es/ page would look like this:

<link rel="alternate" hreflang="es-ES" href="./"/>
not:
<link rel="alternate" hreflang="es-ES" href="./home/"/>

The Solution

The fix is to go in to WPML settings and go to the “SEO Options” area and change the setting from “as early as possible” to “later in the head section”, and click save. Once it is saved, you can revert back to “as early as possible” and click save again.

screenshot

screenshot of the setting in WPML version 3.3.8.

This should fix the problem which is a WPML bug.

If you go to WPML support you will be given the whole “change themes and run debug” runaround. I am very happy with the WPML plugin and people but I’m sure this is a very common problem that has a very easy fix.

I hope this helps someone!

Len

President at Telapost
I create content and do SEO for law firms, small businesses and companies worldwide. I have been generating traffic online since 1992. I have owned multiple successful companies. I'm an organic eater, nature lover and German Shepherd owner. Feel free to contact me here.

Leave a Reply


SEO, Content Marketing, and Social Media Strategy varies drastically depending on which vertical you are in, where you are located, and more. CONTACT ME 919.475.1883