Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 16 replies, has 0 voices.

Last updated by Waqas Bin Hasan 2 days, 7 hours ago.

Assisted by: Waqas Bin Hasan.

Author Posts
September 12, 2025 at 11:57 am #17397457

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Unfortunately we don't have an alternate or temporary solution at the moment. The issue is still under investigation by our compatibility team.

However here's some information I received from the team so far:

- the slug courses (kurser) is used by a CPT and the page "Courses".
- the slug lesson (lektion) is used for 3 different CPTs: Lessons, Quizzes and Assignments hidden link
- But the permalink bases for those CPTs are different in the plugin options hidden link

So it could be that:

- there is a conflict between the permalink base and the CPT slug or
- WP is having a hard time resolving the URL because several CPTs are using the same slug (and the slug translation adds an extra layer of complexity that WP can't handle).

The fact that a few things work on the sandbox where slugs are not translated is a good indicator, but need to investigate more.

Given that, please note that WordPress does not allow the same/duplicate slugs for CPTs and taxonomies. Since I don't have access to your staging site anymore (the temporary link has been expired), please correct the above mentioned in WPML -> Settings -> Post Type Translations and in Tutor LMS settings. These should be unique in all languages (default and translated). Then save the settings, clear caches and try again.

If that helps improving the situation please let us know.

P.S.: I'll be off over the weekend and 'll be able to attend on Monday.

September 15, 2025 at 6:29 am #17400702

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. There's more on this matter by our compatibility team, please consider following.

We can't do much here, the integration is handled by Tutor LMS. In the meantime you can do the following:

1) Don't translate the permalink bases and slugs

- You can go to "WPML > String Translation" and search for "courses" and "lessons" to delete them (admin_texts_tutor_option).
- This will solve the main issue and prevent 404s when navigating from the course to the lesson. Lessons URLs will be resolved.

2) Modify the plugin's code to get the correct URL in the language switcher

Note that we don't recommend this for two reasons:

a) Not future proof. Changes made will be overwritten at the next plugin update.
b) We don't think that a lot of visitors will switch languages in the middle of a course. We believe that the user should complete the full course in the same language (plus we don't think that the lessons already validated in one language will be validated in the second language. This means that the user might have to re-pass all lessons and quizzes).

Having said that, if you want to do it:
- Open /wp-content/plugins/tutor/classes/Rewrite_Rules.php file for editing.
- Replace:

return home_url( "/{$this->course_base_permalink}/{$course_base_slug}/{$this->lesson_base_permalink}/" . $post->post_name . '/' );

- With:

        // WPML Workaround for compsupp-8134 
				$lang_details  = apply_filters('wpml_post_language_details', null, $post->ID);
				$lang = is_array($lang_details) ? ($lang_details['language_code'] ?? null) : null;
				$base = $lang ? apply_filters('wpml_home_url', home_url('/'), $lang) : home_url('/');
				return rtrim($base, '/') . "/{$this->course_base_permalink}/{$course_base_slug}/{$this->lesson_base_permalink}/" . $post->post_name . '/' ;

- Save the file.
- Clear all cache and recheck.