Skip Navigation

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.

This topic contains 2 replies, has 2 voices.

Last updated by erikaG 1 year, 9 months ago.

Assigned support staff: Bruno.

Author Posts
October 23, 2018 at 12:44 pm



We recently had to update one of our customers' website (custom theme) to the latest WordPress version for security reasons. It was running on a rather old version (4.5.3) without issues. We then proceeded to also update every single plugin we use to prevent compatibility issues. Soon after, we realized the secondary language became completely unaccessible.

I first thought it came from the WPML version itself and proceeded to rollback to its older version, without success... We figured out after a while that it came directly from the WordPress version. Whatever the WPML plugin version is, the domain per language option (which is noted as experimental in the administrative section) seems to only work with WordPress older than 4.6. After multiple research on this forum, we still couldn't find out where this issue is coming from.

The link we will provide to you is the development environnement. We restored the staging to the old WordPress version so everything remains functional. This server uses a migration tool, copying the database and the content of the staging to the production server. It is therefore VERY IMPORTANT for you not to touch anything on the staging (, it must remain functional. I'm only providing this URL so you can see for yourself that it indeed worked before the WordPress update. It also is running WPML most recent version (4.0.5). The problem must be fixed on the development environnement (, then we will afterwards repeat the fix onto the staging and proceed to deploy it on the production server.

As you will see, the development environnement ('s langswitch is completely broken and always redirects back to the english version. WordPress runs on version 4.9.8 and WPML runs on 4.0.5.

On the other hand, you will see it fully functional here, on the staging:, which runs also with WPML latest version (4.0.5), but WordPress 4.5.3.

I added a temporary htaccess user for your support, user and password are filled in the FTP fields as there are no fields for it and I don't want those informations to be public (they will be removed once the problem is fixed, of course).

I repeat DO NOT modify anything on the staging, only on the development environnement, this is extremely important. While we do have backups, we don't want to risk this stable environnement to break.

Admin credentials were provided below. As for FTP accesses, I doubt we can provide those as this sever is secured and might contain confidential datas. If absolutely necessary, I will seek our system administrator's help to figure out a way to provide you a restricted access.

Debug info is also provided! 🙂

I think that covers it, feel free to reach back to me if any information is missing.


October 24, 2018 at 2:07 am #2844383


Hello there,

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

Have you tried updating the sunrise.php file that should be inside the wp-content directory? If not, please follow the steps below:

- Open the wp-content/plugins/sitepress-multilingual-cms/inc/tools/
- Copy the sunrise.php file
- Move the new sunrise.php to the wp-content directory

If the problem still persists, please as a test, could you disable all non-WPML plugins, switch to the default theme and see if the problem persists?

If the problem is fixed, please, enable the plugins one by one to see if there is any compatibility problem between these plugins.

Thank you.

October 24, 2018 at 12:52 pm #2846245


No problem for the delay! 🙂

It was indeed the sunrise.php file, I had no idea this even existed, honestly.
When replacing the file with the plugin one the langswitch became functional again.

Unfortunately the file was heavily customized on our side a couple years back and many functionalities don't work anymore when replacing the file. We will need to adjust it back to how it behaved before.

So problem not fully solved, but as the rest of the error was caused on our side, we shouldn't require more support here. Glad to know at least where it comes from, we're getting there!

Thanks a lot, have a great day!