Notification texts go here Contact Us Buy Now!

How to Add the WordPress Logout Link to Navigation Menu?

How to Add the WordPress Logout Link to Navigation Menu?



Do you want to manually add a WordPress logout link on your site? If you run a WordPress membership site, then having a prominent logout link is helpful for your users. In this article, we will share the direct path to WordPress logout link, and how you can add the logout link in your WordPress menu as well as other areas of your site.
Link to logout of WordPress

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.
Log out link in WordPress admin bar
In case you or your site administrator have disabled the WordPress admin bar, then you will not be able to see the WordPress logout link.
The good thing is that the WordPress logout link can be directly accessed to log out of your current WordPress session.
The logout link for your WordPress site looks like this:
http://example.com/wp-login.php?action=logout
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 visit the WordPress logout 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.
Logout confirmation
You can also manually add this logout link anywhere on your WordPress site. Let’s take a look at how to do that.

Video Tutorial


Subscribe to WPBeginner
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 the the logout link in the URL field.
Logout link in navigation menu
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.
Logout link in the navigation menu
The problem with adding the logout link in 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.
Meta widget in WordPress
Some people find the other links in the Meta widget are not quite as useful.
As an alternate, you can also add a plain text or custom HTML widget with the logout link in plain HTML. Here is the HTML code you’ll need to add:
<a href="http://example.com/wp-login.php?action=logout">Logout</a>
Logout HTML widget
That’s all for now.
We hope this article helped you find the direct WordPress logout link and add it on your navigation menu. You may also want to see our ultimate step by step WordPress security guide for beginners.
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.

About the Author

A tech blog focused on blogging tips, SEO, social media, mobile gadgets, pc tips, how-to guides and general tips and tricks

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.