If you use the multilingual plugin WPML and you set up the language settings to use custom folders with the language code in it, e.g., yourdomain.com/en/ you may run into an issue where opening a page on a staging site results in error 404. That can happen when the staging sites permalinks are disabled.
There are three possible solutions:
Create the staging site in a subdomain
You can clone your WordPress website to a subdomain. If you do this, you will not run into any link structure issues anymore, as the URL structure mimics the URL structure on the production website.
Change WPML language URL format
You can switch the WPML language settings on your WP Staging staging site to URL based language like yourdomain.com/?lang=en
You can do this under WPML > Languages
Note: If you push the staging site back to live, you will need to revert this setting on the live site.
You can try to activate post name permalinks on the staging site by following this article.
WPML Troubleshooting Options
After pushing or cloning your WordPress site with WP Staging, the WPML translations might not work as intended. That is often caused by the internal cache handling of WPML. Gladly WPML offers you a few powerful troubleshooting options that you can access to purge and refresh the WPML cache.
The information on this page is for advanced WPML users. If you are not sure what you are doing, please contact WML support before executing any of the WPML troubleshooting options.
You can open the WPML troubleshooting page from WPML > Support.
Click the link troubleshooting.
Before executing any listed action from that options page, create a backup of your WordPress website.
In the table below, you see a description of the most important commands and possible use-case scenarios:
|Command||When to use it|
|Clear the Cache in WPML||
|Remove ghost entries from the translation tables||
|Fix element_type collation||
|Fix WPML table collation||
|Set language information||
|Cleanup and optimize string tables||