Redirect WooCommerce login page to WordPress login

Hi,

I need to redirect the WooCommerce login page to WordPress login, as it seems to be quite difficult to customize WooCommerce login. We're using Brenda for WordPress login customization/styling (it's awesome), but it's not styling WooCommerce login, hence this search for some workaround.

The idea is to have the user login via WP login page, and be redirected to /my-account (the latter is easily done with Brenda).

The best option would be to use Brenda to style the WooCommerce login page, but that seems to be not an option for now.

Thanks for your suggestions.

  • Dimitris Kalliris
    • Support Team Lead

    Hello there M.,

    hope you’re doing well and thank for reaching us! :slight_smile:

    This can be done with a small redirection plugin, please connect to your server via (S)FTP or another file manager program from your hosting provider and create a new MU plugin file like:

    wp-content/mu-plugins/customer-login-redirect.php

    (simply create the /mu-plugins/ folder if it doesn’t exist already)

    and insert in there the exact snippet:

    <?php
    add_action( 'wp', 'redirect_customer_login_access' );
    function redirect_customer_login_access() {
    // Here the conditions (woocommerce my account pages and unlogged user)
    if( is_account_page() && !is_user_logged_in() ){

    // Redirecting to WordPress login area
    wp_redirect( wp_login_url() );

    // always use exit after wp_redirect() function.
    exit;
    }
    }

    Warm regards,

    Dimitris