• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Shortcodes » Create a sidebar login status and logout link

Create a sidebar login status and logout link

Chad Butler · Oct 18, 2012 ·

This article is provided free. Find out how you can get full access to premium content, including how-to articles and support forums, as well as priority email support and member exclusive plugin extensions..

 

In some layouts, you may wish to not use the WP-Members sidebar widget for logging users in, but you may still want to display a user’s login status (when logged in) and provide a logout link.  Here is how you can do that with a plain text widget.

  • Add a plain text widget to your sidebar
  • Add the following shortcodes to the text widget:

    [wpmem_logged_in]
    You are logged in as [wpmem_field user_login].
    [wpmem_logout]
    [/wpmem_logged_in]

  • You’ll need to verify that your sidebar can display shortcodes for this to work.  If the logout link does not show when you are in a logged in state, you will need to enable shortcodes for the sidebar:
    add_filter('widget_text', 'do_shortcode');

    (See “Adding Shortcodes to Other Locations” for more information.)

The resulting widget should only display when the user is logged in and will display the user’s username and a link to logout.  Customize as needed…

Shortcodes, Tips and Tricks shortcodes, tips

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy