[Resolved] page not found when changing the language
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with changing languages smoothly on every page of their website. They have tried resetting WPML settings but the issue persists. The client suspects that the WPML plugin is not working smoothly with their WordPress.com hosting, as it only works with plain permalinks.
Solution: We reviewed the client's site settings and identified that the REST API was not enabled, which could be causing issues with language switching. We provided the following steps: 1. Enable the REST API on the site. 2. Verify the REST API functionality by accessing
and checking for a JSON response. 3. Make a small update on the default Contact page and then update the translation. We also suggested that the client could refer to an article on how to enable the WordPress REST API (https://medium.com/@techreviewgarden/how-to-enable-wordpress-rest-api-754789a081f8) or contact their hosting provider for assistance.
Please note that the solution provided might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues (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 you need further assistance, please open a new support ticket with us.
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.
I understand the issue you're having. A 404 error on the translated page may appear due to the following reasons:
- Corrupted permalink structure
- Page/post is saved in draft
- The same slug is used more than once in one language.
Would you please do the following steps and check if that helps?
- Please ensure that the slug you've used for the posts/pages has not been used for any other post/page in the same language. As WordPress doesn't support identical slugs, it is required to use a unique slug for each post, page, and post type.
- Please go to "Settings > Permalinks" from your WordPress Dashboard
- Resave the structure without making any changes
- Now, switch to secondary language using the language switcher on topbar of the WordPress Dashboard
- Locate the page/post that shows a 404 error.
- Click on "Quick Edit" and make sure that the 'Status' is set to 'Published'.
- Clear the caches from the site and browser then check again.
Please let me know if the steps above help in solving the issue or if you need further assistance in this matter. I will be happy to help.
Thank you for the response.
after doing some research and testing.
I think the WPML plugin is not working smoothly on our WordPress hosting. we host our site directly on WordPress.com. It only works with plain permalink.
This is a comparison coming to the other host provider
hidden link
user: demo
pass: demo1234
this is our staging in WordPress: hidden link
both come from identical sites.
I can give you access administrator if you want to directly test.
Currently, I also ask WordPress.com support to troubleshoot this issue.
Please note that the WPML Plugin is designed to work independently of your hosting environment. Many users successfully run WPML on WordPress hosting platforms without encountering issues. If you're experiencing 404 or 'Not Found' errors on specific pages, this is likely related to a particular setting or configuration, rather than the hosting service itself.
However, I check both the sites you've shared and can see that the Indonesian version of the site is loading properly on both. Please check this screenshot(hidden link) for a better understanding.
Were you able to resolve the problem, or do you still require assistance? Don't hesitate to reach out if you need further support; I'm here to assist you.
I have checked the Indonesian version of the "Privacy Policy" page and noticed the issue. While checking the WPML Debug Info, I noticed that the WPML Sticky Links plugin is enabled. Would you please deactivate the plugin(as it is not required) and check again? If the issue persists, a closer inspection will be required to understand the root cause of the issue.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.
You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
Maybe I'll need to replicate your site locally. For this, Iāll need to temporarily install a plugin called āDuplicatorā or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.
IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link
Hello There,
Thank you for sharing the access information.
I've reviewed the site and noticed it is different from the one you previously shared (hidden link).
However, focusing on the Privacy Policy page where the issue occurred, I accessed the same page on the new site and switched to the Indonesian language. The Indonesian version of the page loaded successfully without any 404 errors on the new site.
I also checked other internal pages, even as a non-logged-in user but haven't encountered the 404 error after switching language. You can check this video(hidden link) I made during the investigation.
Since everything appears to be functioning correctly on the new site, have you resolved the problem? If you're still having issues on the pages I've shown in the video, try clearing your site and browser caches before checking again.
If you're having an issue on any particular page, please share the name/link of the page in the next response. I'll check and be happy to assist you further.
Hey, yeah, Iām coming with a staging environment copy from the LIVE site. It still has an issue when we use custom post permalinks. It only works with plain permalinks. What we want is for it to work with custom permalinks.
Hi There,
Thank you for sharing the access and information about the pages.
When I checked the WordPress setting on your site, I noticed that the REST API is currently not enabled. Please check this screenshot: hidden link
When I tried to access WP-JSON from the Indonesian language, I also encountered a page not found error. This configuration could be causing the issue with Certain Indonesian translations.
You can also check that by going to "WPML > Support" and scrolling down to the "WordPress" section. If you try to access hidden link, you should receive a JSON response, which is not happening in your case.
Could you please enable the REST API on your site and try again? If you're not sure about how you can enable it, you can check this article: hidden link
You can also reach out to the Hosting provider for assistance in enabling the REST API.
After enabling the REST, please make a small update on the default Contact page and then update the translation.
Please let me know how it goes. I will be happy to help if you need further assistance in this matter.