Background of the issue:
My Woocommerce website was created in Spanish and translated into English using WPML plugin. I have 3 Products pages in English that show a 404 error. All other English pages in the WP are OK. Spanish products pages work fine but English don't. I tried resetting the permalinks by resaving them but it didn't fix the issue.
Symptoms:
404 error on English Woocommerce product pages.
Questions:
What might be wrong with the English product pages?
How can I fix the 404 error on the English product pages?
Just a quick note to send you an update on this case.
We've uninstalled a plugin (Disable XML-RPC-API) because it kept changing our .htaccess
It caused issues loading the website and returned a 500 Internal Server Error when trying to access the WP Panel.
(This security subject is well covered now by Wordfence in our website)
We have noticed that hidden link takes you to a 404 Error Page like this: hidden link
Notice that there is a /es/ at the beginning... could this be caused by WPML?
Remember that we are using a specific folder for every language, including the default language: SPANISH
At last but not least, we have discovered that this URL allows us to get into the WP Panel without any strange redirection: hidden link
I hope all this information adds some valuable clue!
Looking forward to hearing back form you.
Sometimes, third-party plugins call the flush_rewrite_rules(true) function too often. This leads to changes in the rewrite rules in your .htaccess file, which can cause issues on your WordPress site.
If that solution still doesn't help resolving the problem, then please here are a 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 any 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 a language folder like /es or /en (if you have one, delete it - WPML take care of the language)
- 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 2021 or 2025.
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.
IMPORTANT: Please take full backup of your website and database beforehand.
It is highly advised to try this on a staging/dev site first, so your live website isn't compromised.
Please let me know your findings and I'll try my best to help you further on the matter.