Logout

Logout Overview

Ultimate Member makes it easy for users to log out of your site. Upon activation of the plugin, Ultimate Member will create a logout page which you will be able to see if you go to all pages in the WordPress admin.

Adding a logout link to the navigation menu

One of the things you’ll probably want to add to your site is a logout link in your site’s menu so members can easily log out of your site. To add a logout link to your menu do the following:

  • In the WordPress admin click on the menu link which can be found under appearance.
  • Once you are on the menus page. Look for the page called Logout in the Pages widget, select the logout page and click the add to menu button. The logout page will now appear as a menu item in the main menu structure widget.

[wp-admin> Appearances> Menus]

Showing the logout menu link to logged-in users

Because it only makes sense to show the logout link to users who are logged in you are going to use the conditional menu logic feature that Ultimate Member has to only show the logout link to logged-in users. To do this, click the small arrow on the right-hand side of the menu item to expand the options for this item.

Once you do this you will see a blue header with the Ultimate Member logo that says: “UltimateMember Menu Settings”. Below this where it says: “Who can see this menu link?” is where you will set the logout link to only show for logged-in users. From the three options select the “logged in users” option and then select the roles you would like to show this link to. Since all roles will need to be able to log out of your site we suggest you select all of the roles.

Once you have done this, save the menu and you will now have a logout link that only appears in the menu for logged-in users

Adding a logout link anywhere on a page

You are not restricted from showing a logout link only in the menu. It is also possible to add a logout link anywhere on your site such as in a button. All you have to do is link the button or another element to go to the logout page e.g http://www.yourwebsite.com/logout. Once a user clicks on the element with this URL they will be logged out of your site

Redirecting users after logging out

You have two options of where to send users after they log out of your site. The first is to redirect them to your site’s homepage (default option in role settings). The second option allows you to specify a URL for where to send users. These options are set on a per role basis, so to edit these options you should go to the logout widget on the edit role page.

[wp-admin> Ultimate Member> User Roles> Edit Role> Logout Options]