Logout button for members

Can you please tell me how to set up a logout link as there is nothing in the software that I can see that members can log out securely.

When users login they remain logged in even if they close browser as login is cached. This is a problem on shared computers.

Many thanks

You can do this in several ways:

  1. If your users can see the admin bar, they can log out with that (from the far right).

  2. You can add a Login/Logout link to a menu using the BAW Login/Logout menu plugin.

  3. If you have the Pro version of s2Member, you can use the widget that comes with it.

  4. You could use the widget provided by the Sidebar Login plugin.

  5. You can simply force a logout after a specified period of inactivity using the Idle Logout plugin (and don’t be put off by the fact it hasn’t been updated for a while: what’s to update when it works flawlessly?)

1 Like

im using

<?php if (is_user_logged_in()):?>
                           <a class="btn btn-sm" href="<?php echo wp_logout_url(); ?>">Logout</a>
                           <a class="btn btn-sm" href="<?php bloginfo('url'); ?>/member-profile/">Edit Profile</a>
                    <?php else: ?>                        
                          <a class="btn btn-sm" href="<?php bloginfo('url'); ?>/log-in/">Login</a>
                          <a class="btn btn-sm" href="<?php bloginfo('url'); ?>/register/">Register</a>
                    <?php endif; ?>

And where do we put that code exactly?