Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

wp_logout logging everyone out instead of just the user that clicked the logout link!

Seems as though the session needed to be destroyed with the following:

        <a href="https://wordpress.stackexchange.com/questions/66309/<?php $redirect = bloginfo("url'); wp_logout( $redirect, $echo ); ?>">
            Logout
        </a>

Related Posts:

  1. How reduce wordpress login session timeout time?
  2. How to show ‘login error’ and ‘lost password’ on my template page?
  3. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  4. Front-end login: Redirect user to the post they had created
  5. Custom Reset Password & Forgot Password Front End Forms
  6. How long do users stay logged in if they DON’T check remember me?
  7. how to logout user on browser tab or window closes
  8. Custom Connect to Facebook, problem logging in/logging out
  9. Preexisting login to change to logout link in sub menu
  10. Session Experies and Get Logged Out Within Few Minutes
  11. WordPress error on log out ‘Not Permitted’ and can’t log out
  12. Add logout link when logged in, make it disappear when logged out?
  13. Lock out all WordPress Administrators except two specific users
  14. How to remove ‘wordpress…’ text from page titles in tabs
  15. WordPress Submitted Content
  16. Create front end member login
  17. Problem with is_user_logged_in() function in some pages
  18. Why deleting/removing cookies in WordPress does not log me out from admin?
  19. How to lock WordPress front-end with login and password?
  20. Front-end login problem: requires re-authorization when accessing dashboard
  21. Inconsistent login state
  22. Can i hide a dynamically created div to logged out users?
  23. In Django, how do I know the currently logged-in user?
  24. Can I programmatically login a user without a password?
  25. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  26. Is there any way to rename or hide wp-login.php?
  27. How to login with email only no username?
  28. How can I redirect user after entering wrong password?
  29. Increase of failed login attempts, brute force attacks? [closed]
  30. Login page ERROR: Cookies are blocked due to unexpected output
  31. Separate registration and login for different roles
  32. SSO / authentication integration with external ‘directory service’
  33. Preventing session timeout
  34. How to prefill WordPress registration with social details
  35. Check for correct username on custom login form
  36. Disallow user from editing their own profile information
  37. I can’t access my site via wp-admin
  38. ‘Password field is empty’ error when using autofill in Chrome
  39. Removing username from the ‘wordpress_logged_in’ cookie
  40. What is $interim_login?
  41. Custom login form
  42. How to prefill the username/password fields on the login page
  43. wp_signon returns user, but the user is not logged in
  44. Adding extra authentication field in login page
  45. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  46. wp_signon() does not authenticate user guidance needed
  47. What exactly is ReAuth?
  48. What are the differences between wp_users and wp_usermeta tables?
  49. Login members using web services
  50. Make my wordpress blog remember my login “forever”
  51. How to check in timber if user is loggedin?
  52. How do I change the language of only the login page?
  53. Disable WordPress 3.6 idle logout / login modal window / session expiration
  54. How to change the default logout link on WordPress Admin
  55. Stop WordPress from logging me out (need to keep me logged in)
  56. Woocommerce registration page [closed]
  57. How to disable autocomplete on the wp-login.php page
  58. Share login data/cookies between multiple installations
  59. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  60. How to pass users back and forth using session data?
  61. How do I change the logo on the login page?
  62. Why does WordPress hide the reset password key from the URL?
  63. Is it possible to sign in with user_email in WordPress?
  64. How to use current_user_can()?
  65. Avoid to load default WP styles in login screen
  66. WordPress registration message
  67. How to fake a WordPress login?
  68. how to display the wordpress login and register forms on a page?
  69. Does wp_logout_url() destroy a session? (Logging out question)
  70. How can I send a welcome email to a user AFTER they login for the first time?
  71. Can not login with correct username and password
  72. Website Visible only to Registered users
  73. How can i increase the login expiration length?
  74. How do I use add_action from a class method?
  75. How to remove the WordPress logo from login and register page?
  76. How can I add a custom script to footer of login page?
  77. Brute force attack?
  78. Customize wp_new_user_notification_email()
  79. Need to execute a cron job
  80. Masking logout URL
  81. Login email after registration never sent or received
  82. How can I create a separate blog that is private?
  83. How to keep always logged in development environment
  84. Add Confirm Password field in wp-login.php Password Reset page
  85. handling login/logout redirects
  86. Integrate recaptcha and wp_signon – what is needed?
  87. Stop users from logging in from multiple locations
  88. WordPress AJAX Login Screen
  89. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  90. custom login page redirect to logged in user profile page
  91. Email address or username used to login in wordpress
  92. How do I check if a post is private?
  93. Receiving “This content cannot be displayed in a frame” error on login page
  94. My login form does not work
  95. share login/logout sessions across two installs?
  96. Change “You are now logged out” text
  97. Programmatically log in a wordpress user
  98. Action wp_login_failed not working if only one field is filled out
  99. Getting “Cookies are blocked or not supported by your browser” on login page
  100. What is the purpose of logging out after WordPress upgrade?
Categories login Tags front-end, login, logout
How do I stop out of stock items from appearing on my WooCommerce site when using the Layered Nav widget [closed]
WordPress Table didn’t look right

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress