Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client updated the slugs for custom post types (CPTs) in different languages using WPML settings but encountered issues where the CPT pages sometimes display a 404 error or redirect to the homepage after the first page refresh. This issue persists even after clearing various caches.
Solution:
We recommend the following steps to troubleshoot and potentially resolve the issue:
1. Ensure that the slug translations are correctly set for each CPT in WPML -> Settings -> Post types translation.
2. Clear the WPML cache by navigating to WPML -> Support -> Troubleshooting -> Clear the cache in WPML.
3. Also, clear the full site cache on your hosting provider's dashboard.
4. If the issue persists, it might be related to how caching is handled on your server. Since the client's server is with Kinsta and caching cannot be disabled, consider testing changes in a staging environment where caching is not enabled.

If these steps do not resolve the issue or if it reoccurs, it might be due to a configuration that is specific to your environment or possibly an outdated solution. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem continues, please open a new support ticket with us for further assistance at WPML support forum.

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

Last updated by Kresimir 1 day, 9 hours ago.

Assisted by: Kor.

Author Posts
February 24, 2025 at 1:38 pm #16741226

Kresimir

Background of the issue:
We have custom post types on our site, and recently we updated their slugs for all of the languages we have on the site. I did that using WPML -> Settings -> Post types translation and then for each CPT I used "Set different slugs in different languages" option to translate the slugs. I deleted all kinds of cache (site, plugin, browser) and the issue still persists for some posts.

Symptoms:
Sometimes the CPT pages/archives will work after deleting WPML cache (using WPML -> Support -> Troubleshooting -> Clear the cache in WPML) or deleting full site cache (our servers are on Kinsta and they have the "Clear all caches" option) but only for a first page refresh. Then when I refresh or visit that page again, it will again either display 404 error or redirect to homepage. This happens for CPTs called "brand", "store", "service" and "catalogue" in all languages.

Questions:
Why do CPT pages lead to 404 or homepage after changing CPT slug?
How can I ensure the CPT pages work consistently after changing slugs?

February 25, 2025 at 8:54 am #16744378

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for contacting us.

Could you please share the URL of the page in question? Also, please make sure to have all cache features turned off on the server and Website for this test.

Then, I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

February 26, 2025 at 1:49 am #16748669

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I've checked your Website and I'm not noticing any issues. Could you list the steps to replicate the issue?

February 26, 2025 at 9:47 am #16750027

Kresimir

I'm not getting errors or redirections now either. Sometimes it works for a while and then it doesn't work for a while.

I'm marking this as resolved as there isn't any issue currently.