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

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
- Add the Logout Button block to an account page or action page template.
- Set the Redirect URL to send users to a specific page after logout.
- Adjust button style, size, and colors in the inspector.
Settings and options
| Option | Type | Default | Description |
|---|---|---|---|
| Show message | boolean | true | Display the “already logged in” message above the button |
| Logged-in message | string | You are already logged in. | The message text |
| Button text | string | Log Out | Button label |
| Redirect URL | string | — | URL to redirect to after logout; empty = WordPress default |
| Button size | string | medium | small, medium, large, or text |
| Alignment | string | left | left, center, or right |
| Border radius | number | 4 | Button corner rounding |
| Text weight | string | 600 | Font weight |
| Button color | string | #2271b1 | Button background |
| Button text color | string | #ffffff | Button text color |
| Button hover color | string | #135e96 | Button hover background |
| Text link hover color | string | #135e96 | Hover color (text style) |
| Underline height | number | 2 | Underline 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.