• 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter brx8r

    (@brx8r)

    I solved the problem. I inherited this site from someone else, and they had defined the constants of WP_SITEURL and WP_HOME in the index.php in the root of the website and wrapped the definitions of those in the config file with if(!defined()). Just had to remove the definitions from index.php and she was apples.

    Hi– I’m having the exact same problem you solved. Could you reply? I have a couple quick questions. TIA.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘"Preview Changes" button doesn't work’ is closed to new replies.