WordPress failure when logging out

I have came across the WordPress logout error several times but I really never figured out the cause of it. In earlier days, it was generally that I was missing a nonce but now even with logout link generated by wp_logout_url();, I am greeted with the WP die screen:

You are attempting to log out of SITE
Do you really want to log out?

What causes this to trigger at the first place?

Edit: Like I mentioned it was happening randomly, I think I figured out something. IT works fine with link generated by wp_logout_url(); but as soon as I use a $redirect parameter in wp_logout_url( $redirect );, I start facing the issue.

Any light on the matter?

1 Answer
1

This message is raised by wp_nonce_ays() which is called by check_admin_referer().

Your browser has probably not sent a referer header, so WordPress could not validate the nonce. This may be a problem in your browser settings or your network connection.

Leave a Comment