Support » Plugin: WooCommerce » Redirect after create an account

  • Resolved fabbb



    I use woocommerce with plugin members only because I want that visitors must be logged before viewing my products.

    So, if a visitor visit or, he is redirected to page wich include short code [woocommerce_my_account]

    He can login if he has a account, or create an account and password if he is a new visitor.

    Then I use the following code :

    add_filter('woocommerce_login_redirect', 'ras_login_redirect');
    function ras_login_redirect( $redirect_to ) {
         $redirect_to = 'http:/';
         return $redirect_to;

    After login he is redirected to the products page.

    The problem is that if a new visitor create an account and password, he is redirected to my-account page.

    I would like that he is redirected to the products page also. http:/

    Does anybody have an idea ?

    Sorry for my english ..



Viewing 1 replies (of 1 total)
    add_filter ( ‘woocommerce_registration_redirect’, ‘my_registration_redirect’);
    function my_registration_redirect( $redirect ) {
    $redirect = ‘’;
    return $redirect;

    /***** HOME AFTER LOGOUT *****/
    add_filter(‘logout_url’, ‘projectivemotion_logout_home’, 10, 2);
    function projectivemotion_logout_home($logouturl, $redir)
    $redir = get_option(‘siteurl’);
    return $logouturl . ‘&redirect_to=’ . urlencode($redir);

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect after create an account’ is closed to new replies.