- This topic has 3 replies, 3 voices, and was last updated 5 years, 9 months ago by .
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
This is my first time to use these forums so I really hope someone can help me because studiopress will not!
I am using the genesis sample theme and I have a logout menu item which I created as a “custom menu”, as shown by the instructions here (http://www.wpbeginner.com/wp-tutorials/how-to-add-the-wordpress-logout-link-to-navigation-menu/)
The custom menu uses this link: http://example.com/wp-login.php?action=logout
However a big problem is that on clicking the link, a new page comes up (which doesn’t maintain any of my site’s design) which says “you are attempting to log out of ________ (my website name). Do you really want to log out?”
This is annoying for the user – I just want them to be immediately logged out and automatically sent back to my homepage. Do you know how to do this?
Many many thanks for any help!
Alex, WordPress novice 🙂
Sorry I wasn't sure if it was safe to put my real URL on there. Here it is:
Can you help?
I replied by email, Alex, but just to follow up here in case it helps anyone else.
You'll need to use
wp_logout_url() instead of hard coding the logout link.
This appends a security nonce to the logout url, which prevents the redirect to the “you are attempting to log out” screen you mentioned.
© 2024 WPEngine, Inc.