Add a logout button anywhere in your Woocommerce store, using Elementor.

Woocommerce customer logout, by default, appears on the ‘My account’ page.  You can add a logout button in your navigation menu using the Woocommerce hooks, but what if you want a logout button only, instead of whole menu? Like in the image below

logout button

This would be better for the user interface because users will have a dedicated logout button at the top, or anywhere you like!

So you added a ‘heading’ or an ‘icon’ using Elementor and placed the Woocommerce logout hook in the link. But, it might not work, and might take you to some other page, rather than signing out.

The solution

  • Go to Apperance > Menus and add a new menu (name it “Logout button menu” so you remember)
  • Add the Woocommerce logout hook, or add a custom URL, name it “Logout” and paste the logout link in the URL. 
    URL Example : https://www.YOURSITEHERE.com/?customer-logout=true
  • Now add this ‘Logout button menu’ wherever you desire and customers would be able to sign out by clicking it.