DOCS

Logout Button

FREE block. A configurable logout button for logged-in users.

Logout button example

Why use this

Fundraisers and donors who have accounts need a way to log out from the frontend without accessing the WordPress admin bar.

What it does

The block generates a WordPress logout link using wp_logout_url(). When clicked, the user is logged out and redirected to the URL specified in the redirectUrl attribute. If redirectUrl is empty, WordPress uses its default post-logout behavior (redirect to the site home or login page). An optional “You are already logged in” message can be shown above the button.

How to use it

  1. Add the Logout Button block to an account page or action page template.
  2. Set the Redirect URL to send users to a specific page after logout.
  3. Adjust button style, size, and colors in the inspector.

Settings and options

OptionTypeDefaultDescription
Show messagebooleantrueDisplay the “already logged in” message above the button
Logged-in messagestringYou are already logged in.The message text
Button textstringLog OutButton label
Redirect URLstringURL to redirect to after logout; empty = WordPress default
Button sizestringmediumsmall, medium, large, or text
Alignmentstringleftleft, center, or right
Border radiusnumber4Button corner rounding
Text weightstring600Font weight
Button colorstring#2271b1Button background
Button text colorstring#ffffffButton text color
Button hover colorstring#135e96Button hover background
Text link hover colorstring#135e96Hover color (text style)
Underline heightnumber2Underline thickness (text style)

What you can and cannot do

  • The block renders for all visitors, not just logged-in users. If showing a message to logged-out visitors is unwanted, use block visibility conditions to hide it.
  • The block does not expose an output filter.