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.
What it does
Section titled “What it does”- Hooks WordPress
login_redirect(and optionallywoocommerce_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 WooCommerceredirect) 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
reauthand interim login.
When to use it
Section titled “When to use it”- 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.
When not to use it
Section titled “When not to use it”Settings
Section titled “Settings”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.
How to enable it
Section titled “How to enable it”- Go to WP PowerSuite -> Modules.
- Filter by Login & Users or search for “Redirect After Login”.
- Turn the module on.
- 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.
How to test it
Section titled “How to test it”- Set Fallback URL to something obvious (e.g.
/sample-page/). - Log out, then log in at
wp-login.phpwithout aredirect_toquery arg. ✅ You land on the fallback page. - With Honor redirect_to on, log in using a URL that includes a safe
redirect_toto another same-site page - that page should win. - If WooCommerce is active and sync is on, log in from My Account and confirm the same rules apply.
- Try saving a fallback that points at
wp-login.php- it should be rejected.
Troubleshooting
Section titled “Troubleshooting”- 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; optionalwoocommerce_login_redirect. - Default filter priority
20, overridable viawp_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.