Background of the issue:
I am trying to save the page in the editor and I'm randomly getting 404 responses from this URL - hidden link. On the normal en version without the /de in the URL, it always works. I looked through the code and saw nothing else editing the wp-json URLs to add any language codes before it, so I think that something in WPML isn't working correctly.
Symptoms:
I expected to see a JSON response. Instead, I got a 404 page returned back.
Questions:
Why am I getting 404 responses on translated pages?
Is there an issue with WPML affecting the wp-json URLs?
Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with the first debugging steps and try to help with the issue quickly.
Here are few things you can check on your end:
- Go to "WPML > Languages > Language URL format" and resave your choice (Different languages in directories).
- On the same page, section "Hide languages": did you hide this language? If so, go to your profile and activate the option "Display hidden languages".
- Go to "Settings > Permalinks" and resave your permalinks
- Access your server via FTP (or Cpanel) and make sure that you don't have a /cs folder (if you have one, delete it - WPML take care of the language repertory)
- Still using FTP, check if you have specific directives in .htaccess that would create that issue. An easy way to discard this issue is to rename the file (.htaccess_old) and resave your permalinks. That should create a new .htaccess
- It could be a compatibility issue with another plugin. Can you try WPML in a miminal environnement?
1. Disable any additional plugin that is not related to WPML and its add-ons and switch to a default theme like 2020.
2. If the issue disappears please start reactivating the plugins one by one, or activate them in small groups. This way you can verify at which point the issue appears again and identify the plugin that is causing the issue.
Please also enable WP_DEBUG to see if you have any PHP errors.
Furthermore, we have released an update for the String Translation addon and it's 3.2.18 now.
The topic ‘[Closed] Random 404 responses on translated pages and /wp-json/ requests’ is closed to new replies.