Do you want to add a WordPress log out link to your site?
If you run a membership site, bbPress forum, eCommerce store, or a learning management system (LMS) using WordPress, having a visible and accessible log out 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 Log Out Link for WordPress
Normally, you can log out of your WordPress site by clicking on the ‘Log Out’ 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 or your site administrator have disabled the WordPress admin bar, then you will not be able to see the WordPress log out link.
The good news is that the WordPress log out link can be directly accessed to log out of your current WordPress session.
The log out link for your WordPress site looks like this:
Don’t forget to replace example.com with your own domain name.
You can access this link directly in your browser window to log out of your WordPress site.
When you click on this link, it will take you to a warning page. You will need to click on the ‘log out’ link to confirm that you really want to log out.
You can also manually add this log out link anywhere on your WordPress website. Let’s take a look at how to do that.
If you don’t like the video or need more instructions, then just continue reading.
Adding the Log Out Link in WordPress Navigation Menus
Adding the WordPress log out 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 log out 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 WordPress blog to see the log out link in your navigation menu.
The problem with adding the log out 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 log out 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 log out or log in link to users.
Some people find the other links in the Meta widget are not quite as useful.
As an alternative, you can also add a plain text or custom HTML widget with the logout link in plain HTML. Here is the HTML code you will need to add:
Adding a Dynamic Log In / Log Out Link in WordPress
If you manually add a log out link in WordPress, then the problem is that it doesn’t change based on the user’s login status.
To fix that, you can use a plugin to dynamically display the log in or log out link based on the user’s session.
After you install and activate the plugin, you must go to Appearance » Menus in your WordPress admin and add the ‘Log In/Log Out’ link to your menu.
After you hit ‘Save Menu’ and check your WordPress website, you will see the link in your menu.
It should look like this.
When you click on it, it will take you to a page to log in, or if you are already logged in, it will log you out.
We hope this article helped you find the direct WordPress log out 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 or our expert picks for the best social media plugins for WordPress.