WooCommerce logout without confirmation: how to remove “Are you sure you want to Logout?”



If you have developed an online ecommerce website using WooCommerce Plugin, during the logout time you might have came across these call to action message that say “Are you sure you want to log out?”

Learn how to hide WooCommerce logout confirmation using code snippet. “Are you sure you want Logout ? ” message removed and solved!

See more on the post:

WooCommerce logout without confirmation YouTube tutorial:
Implement  WooCommerce Logout Without Confirmation

One of the maximum stressful troubles with WooCommerce logout method is that this chronic logout message “Are you sure you want to log out?“ One of my maximum not unusual place requests from WooCommerce improvement customers is to eliminate this message and make the logout method to be computerized or smooth.

WooCommerce logout without confirmation

There is just simple way to remove it:

add_action('check_admin_referer', 'logout_without_confirm', 10, 2);

   function logout_without_confirm($action, $result)



      * Allow log out without confirmation


      if ($action == "log-out" && !isset($_GET['_wpnonce'])) {

      $redirect_to = isset($_REQUEST['redirect_to']) ?

      $_REQUEST['redirect_to'] : '';

      $location = str_replace('&', '&', wp_logout_url($redirect_to));;

      header("Location: $location");



That is the simple way you can be able to remove “Are you sure you want to logout?”

For easy way to add the code to your website, use code snippet plugin:

You may also like to read: Best Free – How to hide WooCommerce in dashboard menu for any role


Support us:

Would love your thoughts, please comment.x

Login To Access Code Snippet:

Stay UpTo Date with Latest Post And news: