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 11 replies, has 2 voices.

Last updated by Itamar 2 months ago.

Assigned support staff: Itamar.

Author Posts
August 6, 2019 at 2:54 pm #4348885

timF-10

Hi,

I have the exact same issue as the guy here: https://wpml.org/forums/topic/yoast-canonical-domain-gets-overwritten-by-wpml/

I commented out:
add_filter( 'wpseo_canonical', array( $this, 'canonical_filter' ) );

This works, but how do I keep this change from being overwritten during the next update?

August 6, 2019 at 6:05 pm #4349835

Itamar
Supporter

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

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

Hi.

The direct answer is that you need to apply this change again after the update.

But since you are referring me to an issue from more than a year ago, I'm not sure that it is still happening.

Can you please confirm that all the related plugins, WPML, and its add-ons and Yoast free and Pro plugins are updated to their latest versions?
Please note that now we have a bridge plugin for Yoast and it needs to be installed.
Please review our documentation here.
https://wpml.org/documentation/plugins-compatibility/using-wordpress-seo-with-wpml/

Could you please share your Debug information with me?
You can read the detailed explanation about it here.
http://wpml.org/faq/provide-debug-information-faster-support
The debug info will give me a lot of information about how your site is configured and will help me understand the source of the problem.

Thanks,
Itamar.

August 7, 2019 at 6:57 am #4352347

timF-10

Hi, all related plugins are updated to the latest version. Also installed the bridge plugin for Yoast without result.

August 7, 2019 at 7:32 am #4352471

timF-10

Even worse actually, the Yoast bridge plugin cancels out the effect of commenting out the beforementioned line, reintroducing the issue.

August 7, 2019 at 6:29 pm #4357355

Itamar
Supporter

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

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

Hi and thanks for trying my suggestions.

Can you please explain to me what you are expecting to get?
Currently, this is what I can see on your site.
The canonical tag for Flemish default language hidden link is:

<link rel="canonical" href="<em><u>hidden link</u></em>" />

And the canonical tag for the Dutch second hidden link language is:

<link rel="canonical" href="<em><u>hidden link</u></em>" />

According to Yoasts documentation this seems correct to me. The canonical should point ot itself if hreflang is also beings used. Which it does and WPML takes care for this as well.
Please see Yoast documentation here.
hidden link
hidden link

Regards,
Itamar.

August 7, 2019 at 7:55 pm #4358007

timF-10

Yes, it works correctly because I've already commented out the specific line. So it works. My question however is: how do I keep it working throughout updates. Because when the line is not commented out I get <link rel="canonical" href="hidden link" /> at duurzametuinartikelen.nl, which of course is not what is should be.

August 8, 2019 at 11:18 am #4362195

Itamar
Supporter

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

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

Hi.

I'm checking this issue. So far, I couldn't replicate it. On my test site, WPML seems to work correctly regarding the canonical tag.
Could you please confirm that the default language of your site is a custom language that you created and its language code is nl_BE?

August 8, 2019 at 11:20 am #4362197

timF-10

Yes the default language has language code nl_BE (duurzametuinartikelen.be). The other language is nl_NL (duurzametuinartikelen.nl).

August 8, 2019 at 11:21 am #4362205

timF-10

If you want I could send you a Duplicator backup of the website through WeTransfer. Only need an email address for that.

August 8, 2019 at 12:18 pm #4362723

Itamar
Supporter

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

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

Hi,

You wrote: "My question however is: how do I keep it working throughout updates. Because when the line is not commented out I get <link rel="canonical" href="hidden link" /> at duurzametuinartikelen.nl, which of course is not what is should be."

Again the direct answer to your question is, that after each update of WPML, you would need each time to comment out this line. But the thing is that I can't replicate this issue on my test site and I think that it is a bug that is happening on your site.

Let's go back and please discuss the other ticket that you are referring me to. This ticket.
https://wpml.org/forums/topic/yoast-canonical-domain-gets-overwritten-by-wpml/
In his reply, Ricardo, my colleague, is referring to this file.
/wp-content/plugins/sitepress-multilingual-cms/compatibility/wordpress-seo/class-wpml-compatibility-wordpress-seo.php
He explains to comment out the following line (33):

add_filter( 'wpseo_canonical',  array( $this, 'canonical_filter' ) );

Is this the file where you are also commenting the line number 33?
If so, then something is wrong here because when I check this file on my test site which has the latest version of WPML, this line, and add_filter function does not exist.
I can see that you are using the latest version of WPML. So I wonder how do you still see this function there.
Can you please elaborate on this issue?

Thanks,
Itamar.

August 15, 2019 at 1:54 pm #4401317

timF-10

Yes, that's the exact line. No idea why I would see a line of code that shouldn't be in mu current version. Do you have an idea what the reason could be. Would it help download and install a fresh version of WPML?

Best regards,

Tim

August 15, 2019 at 7:06 pm #4403139

Itamar
Supporter

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

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

Hi, Tim.

Yes please manually download the latest version of WPML from here https://wpml.org/account/downloads/ and proceed as follows.

1. Take a backup of your site.
2. Deactivate the current WPML Multilingual CMS plugin that is on your website.
3. Delete the plugin.
4. Go to Plugins -> Add new and upload the new downloaded plugin.
5. Activate the plugin.
6. Check if the issue persists.
Please clear all cache from your site. You might also need to update (press the Update button) of the original page, where the problem is, and then also update the translation.

Please let me know if it is working for you.

Regards,
Itamar.

The topic ‘[Closed] Wrong canonical tags’ is closed to new replies.