Skip Navigation

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by marcialB 1 year, 2 months ago.

Assisted by: Ilyes.

Author Posts
September 6, 2023 at 2:33 pm #14353285

marcialB

Hi there

Our website uses language paths and is configured to have a language path for the main language. I just discovered that all pages in the main language are accessible with AND without the path.

Examples:
hidden link and hidden link

hidden link and hidden link

And so on... That shouldn't be the case, right?

For some custom post types, it works correctly though, e. g. hidden link (here, opening the URL without the /de/ part forwards correctly to /de/).

Thanks for your help.

September 7, 2023 at 1:17 pm #14359833

Ilyes
Supporter

Languages: English (English ) French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello,

I would like to ask for temporary access to your test site’s wp-admin and FTP to investigate the issue further.

If necessary, I may need to replicate your site locally. To do this, I will temporarily install a plugin called “Duplicator” on your site, which will enable me to create a copy of your site and its content. Once the problem has been resolved, I will delete the local site. Please let me know if you agree to this.

It is important to note that you should back up your site and database before proceeding, and you can use a plugin like Duplicator for this purpose. Here’s a link to the plugin: http://wordpress.org/plugins/duplicator/

If you do not see the form below, please do not enter your credentials as they will be publicly exposed:

hidden link

For your privacy and security, please ensure that you make your reply a private one.

Best regards,

September 11, 2023 at 10:52 am #14375235

Ilyes
Supporter

Languages: English (English ) French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello,

After further checking, I believe that's how it works with default post types, and it won't affect SEO because the canonical URL points to the right place in both pages:
<link rel="canonical" href="hidden link" />

However, just to make sure of it, I have escalated it to our second tier team to see why isn't it the case with the custom post types.

They might also find a workaround for it.

I will keep you updated once I get any news,

Thank you!

September 11, 2023 at 11:06 am #14375523

marcialB

Hi Ilyes

Thank you for your feedback. I'm looking forward to the response of the second tier support. Having a lot of content "twice" doesn't feel right, even if it is correctly set up for SEO.

Best,
Marcial

September 15, 2023 at 3:03 pm #14404093

Ilyes
Supporter

Languages: English (English ) French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello,

Thank you for your patience,

It was a tricky issue and our second tier team found a workaround that I recommend testing on your staging site first, see if you get any other errors and share your results.

After doing a backup of your site and database, there is a patch you can apply to the class-wpml-canonicals-hooks.php file, found in the ../wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/ folder.

If you change:

			if ( is_string( $install_subdir ) && 0 !== strpos( $actual_uri, '/' . $lang ) ) {

to:

			if ( 0 !== strpos( $actual_uri, '/' . $lang ) ) {

The language URL will always redirect to the correct form,

Please let me know if this helps,

September 18, 2023 at 6:51 am #14409331

marcialB

Thank you. I'll test this and get back to you.