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 thread is resolved. Here is a description of the problem and solution.

Problem:

Is it possible to Keep language canonical even when content is not translated?

Solution:

The Yoast plugin has the option to set the Canonical URL manually. You can do it in the editing screen of the translated pages or posts. For this, you will need to disable WPML Translation Editor. See the SEO section on the editing screen and press the advanced tab. Then insert the URL of the default language, and this will change on the front-end.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by peterZ-12 11 months, 3 weeks ago.

Assigned support staff: Itamar.

Author Posts
October 16, 2018 at 3:36 pm #2821612

peterZ-12

Hi! If I understand the logic of WPML correctly, it keeps the canonical URL of the original page if theres no translation for that page. So for example - if the about page has no German translation, both pages hidden link and hidden link will have a canonical URL hidden link. If I then create a German translation of the about page, the canonical URL for the German version will be hidden link.

My question is - am I able to turn off this feature and always show the canonical URL of that language? So even tho the about page has no German translation, the page hidden link /will have a canonical URL of hidden link?

Live examples:
1) Page WITH a German translation - hidden link (canonical is correctly exponea.com/de/ecommerce-personalization/)
2) Page WITHOUT a German translation - hidden link (canonical is exponea.com/about/, but I would like to have the canonical URL here "exponea.com/de/about/")

October 17, 2018 at 9:00 pm #2825908

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

There is a good reason why the canonical link is to the English default language and the reason is that the content of that page is in English. Changing the link to the German URL will be not a good practice SEO-wise and might hurt your site's SEO ranking. Please read Yoast's article about the canonical subject here. hidden link.

Please let me know if this information is helpful to you.

Regards,
Itamar.

October 18, 2018 at 7:21 am #2826897

peterZ-12

Hi Itamar,

thanks for the information. I know this is the best practise, but we have some reasons as why we would like to keep the canonical URL same as the URL slug. is there any easy way to achieve this? Or would that require a bigger change in the code?

Thank you

October 18, 2018 at 10:56 pm #2829768

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

It does not require a change in the code, but it requires manual work.
The Yoast plugin has the option to set the Canonical URL manually.
You can do it in the editing screen of the translated pages or posts.
For this, you will need to disable WPML Translation Editor.
See the SEO section on the editing screen and press the advanced tab.
Then insert the URL of the default language, and this will change on the front-end.
Please see the attached screenshot.

Please let me know if this information is helpful to you.

Regards,
Itamar.

October 19, 2018 at 7:48 am #2830946

peterZ-12

Hi,

is there also a way how to achieve this without the need to edit every page/post manually?

October 21, 2018 at 9:25 pm #2836084

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

I'm sorry, but there is no built-in option for this with WPML.
This requires custom code which is out of the scope of this support forum.
At this point, I would suggest you consider contacting one of our certified partners from this link: https://wpml.org/contractors/
Before doing so, please have a look also here:
https://wpml.org/documentation/about-wpml-contractors/what-type-of-work-you-can-expect-from-contractors/

With our contractors, you might get the custom assistance you need to get on with your project.

Best Regards,
Itamar.

October 22, 2018 at 8:15 am #2837146

peterZ-12

Ok thank you, we'll code the fix then 🙂