WordPress GuideBuild → One Click URL Logout

How to create a one-click logout link in WordPress

Giving users a fast and easy way to log out improves your site’s usability—especially for membership sites, client dashboards, or online courses. Instead of making people dig through menus or admin bars, you can offer a direct logout button that works instantly.

Let’s walk through how to add that one-click logout link to your WordPress site, along with visibility settings, plugin options, redirect customization, and a bonus method for shortcodes and widgets.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

1. Use a logout URL in a custom menu link

The simplest and most direct way to log a user out is with a specific URL:

https://yourdomain.com/wp-login.php?action=logout

Here’s how to add that link to your navigation menu:

Clicking this link logs the user out and takes them to the WordPress login screen (wp-login.php). From there, they can log back in if needed.

3. Use a plugin to add a logout link

Plugins offer more control, especially if you want a logout link in multiple places (like headers, sidebars, or footers) or want to customize behavior.

Popular plugin options

4. Redirect users after logout (optional but useful)

If you’d rather send users somewhere more helpful than the default login screen, you can modify the logout URL.

Use this format:

Replace the second URL with your preferred destination. You could redirect to:

Plugins like WP Logout Redirect make this even easier without touching the menu URL.

5. Test your logout link for functionality and UX

Make sure your logout link works properly and delivers a smooth experience.

Steps to test:

If you’re using a plugin for visibility, log out and make sure the logout link disappears for visitors.

Bonus: Add a logout button with shortcode or widget

For more flexibility, you can create a logout button using a shortcode and place it in a widget or post.

Create a logout shortcode:

Add this to your functions.php or a small plugin:

Then use [logout_link] anywhere shortcodes are allowed—including sidebar widgets (with a plugin like Shortcode Widget) or Elementor blocks.

Use a block-based button:

If you’re using the block editor, add a Button Block and paste this URL:
https://yourdomain.com/wp-login.php?action=logout

Label it Log Out and style it however you’d like.

Additional resources

How to build a WordPress site →

A complete beginner’s guide that covers 9 key steps to a successful launch

Give your website the dark mode treatment (WordPress) →

Learn how to enable dark mode on your WordPress website to enhance user experience and reduce eye strain.




































How to use WordPress Gutenberg blocks →

A complete beginner’s guide to Gutenberg blocks