"Preview Changes" button doesn't work
-
Hi, I have a bit of a problem with the “Preview Changes” button. I’ve found various things posted on this topic but I’ve been unable to solve the problem.
I’m running WordPress 4.3 and when I hit the “Preview Changes” button when editing a post, I get a new tab with the error message: You do not have permission to preview drafts.
To be more specific initially a new tab pops up pointing at /my-wp-install-dir/wp-admin/post.php then after a few seconds it changes to the URL /my-page/?preview=true&preview_id=193&preview_nonce=6fbb75c97c where the error message is displayed.
I’ve had this happen in 3 environments; 2 linux/apache and 1 local windows one through WebMatrix/IIS. I’ve tried deactivating and even deleting all plugins, and switching to twenty-fourteen theme. I’ve ensured that the hostnames under the General settings match.
Some interesting behaviours I’ve noticed are that pressing “Preview Changes” a second time will actually change the URL in the other tab to /my-page/?preview=true which shows the current page as-is without any of my unsaved changes. A similar behaviour happens when I remove the “preview_nonce” argument from the URL or use an Incognito window in Chrome. Occasionally I get a 404 error though, but I can’t recall the circumstances of that.
I’ve tried clearing my cookies too, rebooting, re-logging in. It happens on two different admin accounts.
I’ve done some debugging and found that at the point of verifying the nonce the User ID is 0 and the session information is blank. This data is used to compare the nonce token, so that’s where it is failing.
This isn’t a new site, and this has worked before, perhaps on a previous version of WordPress.
- The topic ‘"Preview Changes" button doesn't work’ is closed to new replies.