WordPress Error „You do not have permission to preview drafts.“

{0 Comments}

error

As you may have noticed this block can be reached via two URLs. In the options panel WordPress wants to know where it lives (Option WordPress Address) and how it can be reached by regular visitors (Option Site Address).

I have set up everything correctly but faced one problem when I tried to preview posts. It always gave me the error „You do not have permission to preview drafts.“

This happens because we log on to the admin panel via the WordPress Adress URL but when you click the „Preview“ button in the editor you will be redirected to the URL defined in the Site Address Option. You are not logged in on this site so I think this is the origin of this error.

The problem can be fixed quick and dirty by editing the „post.php“ file in your „wp-admin“ directory. Just find the following lines:

Now add one more line which replaces the url you will be redirected to.

Read the comment!

For example the Site Address for this blog is „blog.bastelhalde.de“ and the WordPress Adress is „helios.wh2.tu-dresden.de/~benni_koch/blog“.

Please keep in mind that whenever the post.php file is updated you have to redo the changes! This is no permanent solution but a quick way to preview your posts again. Also please remind that this error can have other causes than a wrong redirection. But if your WordPress Adress differs from your Site Adress it is very likely that you are affected by this because of it.

Leave a Comment

Your email address will not be published.


Time limit is exhausted. Please reload CAPTCHA.