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.

This topic contains 2 replies, has 2 voices.

Last updated by Mary 5 months, 1 week ago.

Author Posts
June 20, 2024 at 12:31 pm #15763569

Mary

Background of the issue:
I have a calendar plugin FullEvents - Ovatheme Events (hidden link). In WPML, I've set the slugs to be /evenement/ in French and /event/ for English. It works... until it doesn't. About once a week, these slugs change (I think they either switch or it changes just for one language) and create 404 errors. Temporarily correcting the issue is not complicated: I empty the cache and resave the permalinks and everything works again. But of course, I don't always catch this error as it happens, so visitors encounter a lot of 404 errors. I would like a permanent fix for this.

Symptoms:
URL slugs for each language change automatically, causing 404 errors.

Questions:
How can I prevent the URL slugs from changing automatically?
Is there a permanent fix to avoid 404 errors caused by slug changes?
Why do the slugs change about once a week?
Is there a way to automate the process of emptying the cache and resaving the permalinks?

June 20, 2024 at 2:08 pm #15764451

Marsel Nikolli

Thank you for contacting WPML support,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

It seems that this might be caused by certain third-party plugins calling the flush_rewrite_rules(true) function too often. This causes WordPress to overwrite .htaccess and as a result, create 404 errors.

I would suggest you try following the instructions shown in the link here:
https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

After that try re-saving the permalinks and see if the issue still happens.

Kind regards,
Marsel

June 20, 2024 at 3:08 pm #15764920

Mary

OK, I've done the workaround. The error could take a week or even two to reappear, so I'll see what happens in the coming week or two. Thanks!