Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: We are unable to preview drafts in secondary languages.

Solution: Disabling "Auto sign-in and sign-out users from all domains" from WPML -> Languages resolved the issue.

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 andersH-10 3 years, 3 months ago.

Assigned support staff: Lauren.

Author Posts
March 13, 2018 at 3:10 pm #1544912


We are using "A different domain per language". Default language is Swedish and secondary - Norwegian. Let's use real URLs in my local environment:
Swedish - hidden link
Norwegian - hidden link

When I go to Swedish post editing on Norwegian domain (e.g. hidden link) and then click Preview button I get to the page hidden link with error message: "Sorry, you are not allowed to preview drafts." (500 error)

During debugging I figured out the reason of the issue with drafts preview:
when you go to the NO domain, then edit some draft SE post, and then click Preview button - the system generates security token (preview_nonce) based on session cookie and other stuff. But then WPML redirects you to SE domain because you are previewing SE post and WP validates the token - but for validation WP uses session cookie set for SE domain and that's why validation isn't passing (session cookies are different) and we get the error.

When I click Preview button again (without changing anything) then a new tab is opened with URL like this hidden link and Preview works fine. It also works when clicking Preview link from posts overview page (hidden link), in this case the URL looks exactly like when clicking Preview button in post editing second time.

So it works when there is no preview_nonce in the URL hence no validation and session cookie doesn't matter. Attached screenshots.

I have found several similar issues on WPML forum like this one
the last post says - "This problem is fixed in WPML versions 3.2 and above."

Would it be possible to fix the issue? Any advice appreciated.


March 14, 2018 at 11:13 pm #1546406


Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

I'd like to have you try a few things so we can try to isolate the issue. This is just to help me identify if it might be a conflict with another plugin or theme that is causing the problem.

** IMPORTANT ** Please backup a working copy of site files and database before continuing.

Update WordPress core.

Disable all plugins except WPML related and then temporarily change the theme to a default WordPress such as TwentySeventeen. With these settings, is the issue resolved?

March 16, 2018 at 1:54 pm #1548101


Hi Lauren,

the bug has gone after we disabled the WPML option "Auto sign-in and sign-out users from all domains".
We disabled the option due to other bugs that we had on the site and found the suggestion on the forum to disable the option. It was certainly a coincidence that the bug reported in this ticket disappeared as well.