Do you want to add a WordPress logout link to your site?
If you run aΒ membership site, bbPress forum, eCommerce store, or a learning management system (LMS) using WordPress, having a prominent logout link is helpful for your users.
In this article, we will show you how to add the WordPress logout link to your navigation menu, as well as to other areas of your site.
The Logout Link for WordPress
Normally you can log out of your WordPress site by clicking on the logout link. This link is located below your profile picture in the top right corner of theΒ WordPress admin bar.
All you have to do is take your mouse over to your username, and it will appear in the dropdown menu.
If you donβt like the video or need more instructions, then continue reading.
Adding the Logout Link in WordPress Navigation Menus
Adding the WordPress logout link in your siteβsΒ navigation menuΒ will make it easily accessible from any page on your website.
Simply head over to theΒ Appearance Β» MenusΒ page in your WordPress admin. After that, you need to click on the custom links tab to expand it and add the logout link in the URL field.
Once you are done, click on the βAdd to menuβ button, and you will notice the link appear in the right column. You can adjust its position by simply dragging it up or down.
Donβt forget to click on the βSave Menuβ button to store your changes.
You can now visit your website to see the logout link in your navigation menu.
The problem with adding the logout link in the menu is that it is visible to all users (both logged-in and logged-out). It only makes sense to show the logout link to users who are actually logged in.
You can do that by following our instructions on how toΒ show different menus to logged in users.
Add WordPress Logout Link in the Sidebar Widget
WordPress comes with a defaultΒ widgetΒ called Meta. This widget shows a bunch of useful links including a logout or login link to users.
Adding a Dynamic Login / Logout Link in WordPress
If you manually add a logout link in WordPress, then the problem is that it does not change based on the userβs login status.
To fix that, you can use a plugin to dynamically display the login or logout link based on the userβs session.
First, youβll need to install theΒ Login or Logout Menu ItemΒ plugin. For details, see our step-by-step guide onΒ how to install a WordPress plugin.
After you install and activate the plugin, youβll go toΒ Appearance Β» MenusΒ in your WordPress admin and add the Login/Logout link to your menu.
After you hit βSave Menuβ and check yourΒ WordPress website, youβll see the link in your menu.
When you click on it, itβll take you to a page to login, or if youβre already logged in, it will log you out.
This method also works withΒ WooCommerce,Β MemberPress, and otherΒ WordPress eCommerce platforms.
We hope this article helped you find the direct WordPress logout link and add it to your navigation menu. You may also want to see our guide onΒ how to add a call buttonΒ in WordPress, andΒ how to track link / button clicks in WordPressΒ to make data-driven decisions.
If you liked this article, then please subscribe to ourΒ YouTube ChannelΒ for WordPress video tutorials. You can also find us onΒ TwitterΒ andΒ Facebook.