All the WordPress membership site users will know that enabling a WordPress logout link prominently on your website will be helpful for your visitors. And if you are looking for a guide to manually set-up a WordPress logout link, then you are at the right place. This article will provide a detailed guide to the direct path to WordPress logout link, adding the link in your WordPress navigation menu and how to enable the logout link only for the logged in users.
How to Logout on your WordPress site?
In order to logout from your WordPress site, usually you can access the logout link below your WordPress profile picture located at the top right corner of the admin bar. Hover your mouse on you username and in the dropdown menu you can find the logout button.
How to access the Logout link from the browser?
The WordPress logout link will not be visible if you or your website admin has disabled the WordPress admin bar. In which case, the WordPress logout link comes in handy in order to log out of the current session.
Here’s how you can easily access the Logout Link:
In your browser, go to the link http://example.com/wp-login.php?action=logout while replacing the example.com with your domain name.
This link can be used to directly log out of the current session of your WordPress site.
The above link will prompt you with a warning page as a confirmation that you actually want to log out. Upon confirmation, you will be successfully logged out of your WordPress website.
How to manually add the Logout link in the navigation menu of your WordPress website?
You can even create a manual logout link and place it anywhere in the navigation menus on your WordPress site. This manual link in the navigation menu will help the users to log out of your site conveniently from any page.
Here’s how to add a manual Logout link on your WordPress site:
1. On the WordPress admin page, go to Appearance -> Menus
2. Now, click on the Custom Links field to expand
3. Here, paste the logout link as shown above in the URL field.
4. After that, click on the ‘Add to menu’ button. This will enable the link in the column on the right.
5. Adjust the position of the link by dragging it.
6. Save your changes by clicking on the ‘Save Menu’ button.
7. And it’s done! Check your website to find the logout link placed in your navigation menu.
Well, if you are happy with the results, here’s the problem. Adding the logout link in the navigation menu is not so much of a good news because in this case, it will be visible to all users, whether they are logged in or not. Ideally, the logout link should be visible only to those users who have actually logged in.
Here’s how to show different menus to those users who have logged in to your website:
This can be achieved through one of the default widgets of WordPress called META. This
widget contains several useful links including the link for login and logout.
Alternatively, a plain text or a custom HTML widget containing the WordPress logout link in plain HTML will also work. You’ll be required to use this HTML code: <a href=”http://example.com/wp-login.php?action=logout”>Logout</a> while replacing the example.com with your website domain.
And you are done!
That’s how you can add the logout link for your WordPress website quickly and easily. We hope this was a useful read. Do let us know in the comments how you were able to place the Logout link on your site.