Modules / Site & media

Site: login and logout redirects

Login, registration and logout redirect URLs

Send people to a page you choose after they log in, register or log out. Set one URL for the whole site, or a different URL per user role.

#30 of 39 modules by votes

  • Off until you switch it on
  • Needs Bricks 2.4 or newer
  • Tested with Bricks 2.4.3

Tile 30 of 39, ranked by votes · Recording in progress

Where to find it in the builder

Only in Bricks > Kiln, under the module's row. The module adds no builder controls. It changes where WordPress and WooCommerce send people after the login form, the registration form and the logout.

How to use it

  1. Open Bricks > Kiln and turn on Site: login and logout redirects.
  2. Open the module's settings under its row.
  3. Enter a URL in After login, After registration and After logout. Leave a field empty to keep the default for that event.
  4. To send a role somewhere else, enter a URL next to that role under By role. It applies to login and registration, and the first role in the list that the user has wins.
  5. Save the page.

You can enter a full URL or a path such as /my-account/.

How it works with "log in to continue" links

A link that asks for its own destination keeps it. This covers WordPress login links with a redirect_to address, and WooCommerce login forms that carry a redirect. Your URL applies when nothing else asked for a destination. WordPress' default of the admin dashboard counts as no request.

Limits

  • Only URLs on your own site, or on a host WordPress allows for redirects, are saved. Any other URL is cleared when you save.
  • Roles apply to login and registration. Logout uses the After logout URL for everyone.
  • A role URL beats the site-wide URL. A user with several roles gets the URL of the first of their roles in the list.
  • After registration, the role rule applies when the new user is logged in at that point. Otherwise the After registration URL is used.
  • Bricks' own bricks/auth/custom_*_redirect filters choose which page replaces wp-login.php. They do not set where a user goes afterwards, so Kiln does not use them.

Settings

Under the module's row in Bricks > Kiln:

  • After login, After registration, After logout: one URL each.
  • By role: one URL field for each role on your site.

The module is off by default because it changes behavior as soon as you fill in a URL.

Requirements

Bricks 2.4 or newer. WooCommerce is not required. The WooCommerce login and registration forms are covered when WooCommerce is active.