• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Logout menu button takes user out of website!

Welcome!

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.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Logout menu button takes user out of website!

This topic is: not resolved

Tagged: custom menu, logout, logout button, logout menu

  • This topic has 3 replies, 3 voices, and was last updated 5 years, 4 months ago by Nick.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 10, 2018 at 10:31 pm #219748
    telvlcy20
    Member

    Hi Everyone,

    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 🙂

    May 11, 2018 at 5:10 am #219757
    Victor Font
    Moderator

    Are you really using a link with example.com instead of your domain name?

    Please post a link to your site so we can see the code.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 11, 2018 at 7:14 pm #219786
    telvlcy20
    Member

    Hello Victor,
    Sorry I wasn't sure if it was safe to put my real URL on there. Here it is:
    http://www.myretrieval.com/wp-login.php?action=logout

    Can you help?
    Alex.

    May 26, 2018 at 3:39 am #220237
    Nick
    Participant

    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.

    Example here.

    This appends a security nonce to the logout url, which prevents the redirect to the “you are attempting to log out” screen you mentioned.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble