What Does the Feature Do?
The WooCommerce My Account page contains order history and account details, which guests cannot use. The Redirect My Account for Non-logged-in Users feature sends guests who open that page to a useful destination instead, such as the login page or a custom URL.
The destination is configurable, and a custom URL lets you control where guests land.
Why You Need It
Guests browsing My Account see content they cannot use:
- Order history and account details need a login
- Sending guests to the login page gives them a clear path in
- A custom URL can route them to a registration or landing page
- Logged-in users still see the account page normally
How to Redirect My Account for Non-logged-in Users
Step 1: Enable the Feature
- In WordPress admin, open Classic Monks > WooCommerce.
- Open the Redirection settings area.
- Toggle on Redirect My Account for Non-logged-in Users.

Step 2: Choose the Destination
- Redirect Page: pick the login page, a specific page, or Custom.
- If you choose Custom, enter a Custom URL.
Step 3: Save and Test
Click Save Changes. Log out, open the My Account page, and confirm you are redirected to your chosen destination. Log in and confirm the account page shows normally.
Configuration Options
| Option | Behavior | Default |
|---|---|---|
| Redirect My Account for Non-logged-in Users | Master toggle. | Off |
| Redirect Page | Login, a selected page, or Custom. | Login |
| Custom URL | Destination when Redirect Page is set to Custom. | Blank |
What Gets Affected
- The My Account page for guests: they are redirected away from it
- The destination page: receives the redirected guest
What Does NOT Get Affected
- The My Account page for logged-in users: shows normally
- The login page: it is a redirect target, not altered
- Saved addresses and carts: unaffected
Advanced Options (Developers)
The feature registers one hook in functions/woocommerce/woocommerce-functions.php:
add_action( 'template_redirect', 'cm_redirect_my_account_access' );
template_redirect calls cm_redirect_my_account_access() to detect when a guest opens the My Account page and redirect them to the configured destination.
Common Use Cases
Drive login or registration. Sending guests to the login page (or a custom registration page) encourages account creation.
Standard landing. A custom URL routes guests to the page that makes most sense for your store.
Protect account data. Guests do not see order history and account content they cannot access.
Keeping It Set Up
Set the toggle once and it stays active across the site. To change behavior, return to the WooCommerce settings, adjust the option, and save again. The store continues to run normally throughout, and you can turn the feature off at any time to restore the previous default behavior. For teams managing multiple environments, confirm the setting on staging first, then apply it to production and verify a real page load before treating it as live.