Login / out

With this block, you can display a login form or a link that lets the visitor log in or out.

Block category: Theme.
Added in: WordPress 5.8

Sidebar settings

  • Display login as form
  • Redirect to current URL
  • Advanced: Additional CSS classes

Example

The sidebar settings for the login/out block has two toggles: Display login as form, and redirect to current URL.

The look of the form depends on your theme:

A basic login form created with the login/out block has a username or email field and a password field.
There is a "remember me" checkbox
above the submit button. The text on the submit button is Log In.

Markup

<!-- wp:loginout /-->

<!-- wp:loginout {"displayLoginAsForm":true} /-->

Example log out output

<div class="logged-in wp-block-loginout"><a href="your website url/wp-login.php?action=logout&amp;redirect_to=your url">Log out</a></div>