This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Mihai Apetrei 1 year ago.

Assigned support staff: Mihai Apetrei.

Author Posts
October 5, 2018 at 1:53 am

jasonK-12

I am trying to: get hreflang to work

Link to a page where the issue can be seen: hidden link

I expected to see: <link rel="alternate" hreflang="en-us" href="/2016/05/" />

Instead, I got: <link rel="alternate" hreflang="en-us" href="/2016/05/" />
<link rel="alternate" hreflang="es-es" href="/2016/05/" />

It keeps putting hreflang=en and hreflang=es on the english only page. We have the spanish version of the page here hidden link - I'm not sure why both EN and ES hreflang tags are getting applied to the english version.

October 5, 2018 at 9:37 am #2790177

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for contacting WPML Support!

I will be happy to help you with this.

First of all, we need to fix something that's currently wrong on the site.

If you add your site's address in here (https://technicalseo.com/seo-tools/hreflang/) and test, you will see that the language tag is wrong.

Please follow the example here (check the yellow columns in the attached screenshot image):
https://wpml.org/documentation/support/adding-hreflang-wordpress/

This should be an easy fix where you just need to replace the English hreflang to en and the Spanish hreflang to es.

Regarding the questions you had, having multiple hfrelang records in the same page is completely normal as they use different links, too.

For example on your site's homepage, we see:

<link rel="alternate" hreflang="en-us" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="es-es" href="<em><u>hidden link</u></em>" />

So we can clearly see that the hreflang attribute is different each time and also the links.

However, what's not normal, as you stated already, is the fact that we have the same link for both languages on the archive page link you gave me.

Can you please turn off all the caching and Cloudflare, too?

There might be a caching issue causing this.

Let me know after you've done that.

October 5, 2018 at 2:17 pm #2791081

jasonK-12

hi thanks for the response! i went ahead and updated the hreflang tag like you suggested just to en and es.

i went through and temporarily disabled cloudflare and caching and both of the hreflang tags still remained on those archive pages. im hesitant to leave these off for a long period of time on the site as they really help loading speed, but when i disabled them the hreflang tags were still there on the archive page

hidden link

October 8, 2018 at 4:12 pm #2796899

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

Thank you for the update.

I will need you to please try the following debug steps, preferably on a staging version of the site or on your live site but only after you create a full backup of both the site files and the database.

❌ Before proceeding please make a full website backup! ❌

• Disable all the plugins except WPML and its add-ons, WooCommerce and WooCommerce Multilingual
• Set a default theme (eg. Twenty Sixteen).
• If the issue is solved, please re-enable the Plugins one after the other, and check the issue each time you enable a plugin.

It might also be an issue caused by the theme the site is using.

Please do reactivate your Theme only after you are sure the issue isn't coming from a 3rd Party Plugin.

Please let me know how it goes and what you will be able to find.

I will be waiting for your answer.