Skip to content

Redirect After Login

Redirect After Login controls where people land after a successful sign-in. Set a site-wide fallback URL, optionally sync the same rules to WooCommerce, and (with Premium) send different roles to different pages - while still honoring safe deep links when you want them.

  • Hooks WordPress login_redirect (and optionally woocommerce_login_redirect).
  • Applies rules only when a fallback URL and/or licensed per-role URLs are configured - otherwise WordPress defaults stay unchanged.
  • Can honor redirect_to (and WooCommerce redirect) before role/fallback rules.
  • Rejects destinations that point at the login page (including a custom login slug from Change Login URL).
  • Skips its own role/fallback logic when Login as User uses its sentinel value, so that flow keeps its intended destination.
  • Preserves sensitive flows such as reauth and interim login.
  • Members should land on a dashboard, account page, or course area after login.
  • Shop customers should return to My Account (or another store page) consistently.
  • Agencies want one fallback for most users and Premium per-role URLs for staff.

Open the module’s advanced settings (gear icon):

Setting Key Notes
Honor redirect_to honor_redirect_to Default on. Prefer a valid request redirect_to / Woo redirect before role or fallback.
WooCommerce sync woocommerce_sync Default on when WooCommerce is active. Mirrors rules on My Account login.
Fallback URL fallback_url Same-site URL or path (e.g. /my-account/). Used when no role URL applies.
Enable per-role redirects enable_role_redirects Premium / valid license required for role URLs to apply.
Role redirects role_redirects Map of role -> URL. First matching role in a stable order wins.

Login-page URLs are rejected on save and at runtime.

  1. Go to WP PowerSuite -> Modules.
  2. Filter by Login & Users or search for “Redirect After Login”.
  3. Turn the module on.
  4. Open settings, set at least a Fallback URL (and/or Premium role URLs), then save.

Until a fallback or licensed role URL exists, the module shows that no redirect rules are active yet.

  1. Set Fallback URL to something obvious (e.g. /sample-page/).
  2. Log out, then log in at wp-login.php without a redirect_to query arg. ✅ You land on the fallback page.
  3. With Honor redirect_to on, log in using a URL that includes a safe redirect_to to another same-site page - that page should win.
  4. If WooCommerce is active and sync is on, log in from My Account and confirm the same rules apply.
  5. Try saving a fallback that points at wp-login.php - it should be rejected.
  • Still going to wp-admin / default. Confirm a fallback or licensed role URL is saved; check the inactive-rules notice in settings.
  • Per-role URLs ignored. Activate a valid Premium license and enable per-role redirects with at least one non-empty role URL.
  • Deep link ignored. Turn Honor redirect_to on, or ensure the requested URL is valid and not the login page.
  • Login as User destination wrong. Expected that this module leaves that flow alone when the Login as User sentinel is used.
Why does nothing change after I enable Redirect After Login?

The module stays inactive until you set a Fallback URL and/or licensed per-role URLs. Honor redirect_to and WooCommerce sync alone do not change destinations.

Can I redirect to the login page?

No. Login-page URLs (wp-login.php or your Change Login URL slug) are rejected to prevent redirect loops.

Are per-role redirects free?

No. Per-role URLs require an active WP PowerSuite Premium license. Fallback URL works on the free plan.

Does it work with WooCommerce?

Yes. With WooCommerce sync enabled, the same rules apply via the woocommerce_login_redirect filter.

Developer notes (hooks & filters)

Source: modules/redirect-after-login/module.php (settings UI: modules/redirect-after-login/admin.php). Boot: critical.

  • Filters: login_redirect; optional woocommerce_login_redirect.
  • Default filter priority 20, overridable via wp_powersuite_redirect_after_login_priority.
  • Skip application: wp_powersuite_redirect_after_login_should_apply.
  • Final URL filter: wp_powersuite_login_redirect_url.
  • Credential POST detection filter: wp_powersuite_redirect_after_login_credential_post.
  • Integrates with Change Login URL via wp_powersuite_change_login_logged_in_redirect.
  • Public helper for OAuth / non-wp-login flows: Module::applyPostLoginRedirectFilters().
  • Sentinel constant Module::REQUESTED_REDIRECT_LOGIN_AS_SENTINEL (__wpps_login_as__) - when passed as $requested_redirect_to, role/fallback rules are skipped.
  • Role URLs only apply when wp_powersuite_is_license_valid() is true.