Black Friday 40% off yearly and lifetime plans · 18d left Ends in 18d09h23m Claim 40% off
WooCommerce50 docs

How to Redirect Guests From the WooCommerce My Account Page

Send guests who visit the WooCommerce My Account page to the login page or a custom URL. Choose the destination for non-logged-in users in Classic Monks.

By Founder & Lead Developer

Last updated

2 minutes

Key takeaways

  • Redirect guests who open My Account
  • Send them to the login page or a custom URL
  • Choose the destination from the settings
  • Keeps account content restricted to logged-in users
  • Uses WooCommerce’s template redirect hook

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

  1. Step 1

    Enable the Feature

    1. In WordPress admin, open Classic Monks > WooCommerce.
    2. Open the Redirection settings area.
    3. Toggle on Redirect My Account for Non-logged-in Users.

    WooCommerce redirection setting enabled

  2. Step 2

    Choose the Destination

    • Redirect Page: pick the login page, a specific page, or Custom.
    • If you choose Custom, enter a Custom URL.

    Redirect destination dropdown menu

  3. 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.

Frequently asked questions

Who gets redirected?

Visitors who are not logged in when they open the My Account page.

Where do they go?

To the destination you choose: the login page, a specific page, or a custom URL.

Do logged-in users see the account page?

Yes. Logged-in users view My Account normally.

Can I use a custom URL?

Yes. Set Redirect Page to Custom and enter the Custom URL.

Troubleshooting

3 problems and how to fix each one.

The redirect is not happening

Cause: The toggle is off, or the visitor is recognized as logged in.
Fix: Confirm the toggle is on and that the visitor has no active session. Test as a logged-out guest.

It goes to the wrong page

Cause: The destination setting points somewhere unexpected.
Fix: Review Redirect Page and, if Custom, the Custom URL. Save and test again.

Logged-in users are redirected too

Cause: The redirect applies only to non-logged-in users.
Fix: Confirm the visitor being tested is truly logged out. If logged-in users redirect, check for a conflicting plugin.

Was this doc helpful?

Your answer tells us which docs to fix first.

Still stuck? Ask on the forum or email help@classicmonks.com.
Joy Chetry
Written by the person who built it

Joy Chetry

Founder & Lead Developer, Classic Monks

Joy is the founder of Classic Monks and GoodMonks Solutions, a web development agency that builds WordPress and WooCommerce sites for clients. Classic Monks grew out of the agency's own need to consolidate 20 to 30 separate plugins into one core stack.

Follow this doc on a real site.

Open a private WordPress site with Classic Monks, WooCommerce and Bricks Builder installed, and follow this doc step by step. Free for 24 hours, no card.

280 docs, written by Joy Chetry 15 day refund window