Below code work form me.

add_filter(‘wp_nav_menu_items’, ‘add_login_logout_link’, 10, 2);
function add_login_logout_link($items, $args) {
$loginoutlink = ob_get_contents();
$items .= ”. $loginoutlink .”;
return $items;

The plugin “Suffusion Shortcodes” by Sayontan Sinha has a very nice shortcode that allows you to add an entry to a text widget or to anywhere else, that toggles. If you are logged out it shows Log In, if you are logged in, it shows Log Out.

Totally simple and easy. In other words, perfect for me! 🙂

Hi – would it be possible for you to post screenshots of what the Login/Logout link looks like to a user? I’m trying to get a sense of whether we should do this or not. Thank you!!

The link would show up in the menu you are editing. How that is displayed would be dependent on your theme. We are using the Memberlite theme on our site, and you can see how the login/logout link looks in our menu in the upper right of this page.

just tried to import bas login/logout plugin and was informed by wordpress that the plugin has not been updated for the past 2 years, do you still recommend this plugin.

It should still work, but I don’t recommend it as much.

If you are using Theme My Login, that plugin now has a feature where any Login item in a menu automatically becomes a Login/Logout link. You can try that.

I installed the BAW Login Menu and then created a widget for my protected content pages that simply includes the shortcode [loginout] – this allows for a log in or log out link very easily in a widget position.

Leave a Reply

For faster support related to issues on your specific site please open a ticket in our members support area.

Your email address will not be published. Required fields are marked *