Woocommerce redirect after registration

woocommerce logout redirect
redirect after login
wordpress redirect register page
wordpress redirect after registration
divi redirect after login
wordpress redirect after login based on role
wpforms redirect after submit
redirect after login, registration, and logout

I am trying to redirect user after Woocommerce registration. I have tried everything and it is not working.

I have tried some methods found on internet but they didn't work…

When I change 'myaccount' to another permalink it just freezes when you click register.. not sure why.

wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() : wc_get_page_permalink( 'welcome' ) ) 

I even tried with the page id

wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() : wc_get_page_permalink( '1072' ) ) 

Any help?

The accepted answer didn’t work for me. What worked for me was this:

// After registration, logout the user and redirect to home page
function custom_registration_redirect() {
    wp_logout();
    return home_url('/');
}
add_action('woocommerce_registration_redirect', 'custom_registration_redirect', 2);

Woocommerce redirect after registration, The accepted answer didn't work for me. What worked for me was this: // After registration, logout the user and redirect to home page function  By default, WooCommerce redirects users to the “my account” page after registration, login, and logout. This plugin allows you to redirect users to custom pages and URLs such as “home,” “offers,” “catalog,” the previous page, or any external link. Features List: Configure different redirects after registration, login, and logout.

Redirect Users After WooCommerce Login or Registration, It's possible to redirect your users to a page other than My Account when they login or register. Try adding the following code using the Code Snippets plugin,  WooCommerce Redirect After Registration. Posted on January 27, 2020 January 27, 2020 by Addifypro WooCommerce Redirect After Registration. Post navigation

You want to use a filter like this:

function plugin_registration_redirect() {
    return home_url( '/page-to-show' );
}

add_filter( 'registration_redirect', 'plugin_registration_redirect' );

Or, specifically to your code:

function plugin_registration_redirect() {
    $url = wp_get_referer() ? wp_get_referer() : wc_get_page_permalink( 'welcome' );
    return $url;
}

add_filter( 'registration_redirect', 'plugin_registration_redirect' );

WooCommerce Login Redirect – WordPress plugin, Custom redirect after registration/login in WooCommerce plugin. You have to install WooCommerce plugin. Redirect function will work when the user will use  WP WooCommerce Redirect is a WordPress plugin to redirect your WooCommerce website after register or login! You can set any custom page or custom redirect according to user role. You can set user login and register redirection page without any codding knowledge to your WooCommerce website .

WP WooCommerce Redirect is a WordPress plugin to redirect your WooCommerce website after register or login! You can set any custom page or custom redirect according to user role.

You can set user login and register redirection page without any codding knowledge to your WooCommerce website . Your customer reduce time for using this plugin and get their destination easily.

I have developed a plugin for this issue. Also given bellow of raw code for redirect without any plugin.

//Redirect users to custom URL based on their role after login
function wp_woo_custom_redirect( $redirect, $user ) {

// Get the first of all the roles assigned to the user
$role = $user->roles[0];
$dashboard = admin_url();
$myaccount = get_permalink( wc_get_page_id( 'my-account' ) );

if( $role == 'administrator' ) {

    //Redirect administrators to the dashboard
    $admin_redirect = get_option('admin_redirect');
    $redirect = $admin_redirect;
} elseif ( $role == 'shop-manager' ) {

    //Redirect shop managers to the dashboard
    $shop_manager_redirect = get_option('shop_manager_redirect');
    $redirect = $shop_manager_redirect;
} elseif ( $role == 'customer' || $role == 'subscriber' ) {

    //Redirect customers and subscribers to the "My Account" page
    $customer_redirect = get_option('customer_redirect');
    $redirect = $customer_redirect;
} else {

    //Redirect any other role to the previous visited page or, if not available, to the home
    $redirect = wp_get_referer() ? wp_get_referer() : home_url();
}
return $redirect;
}
add_filter( 'woocommerce_login_redirect', 'wp_woo_custom_redirect', 10, 2 );

If you feel comfort to work with plugin or without code? You can download and install my plugin "WP WooCommerce Redirect"

Custom Redirect after registration in WooCommerce, Internally, WooCommerce uses WordPress' wp_safe_redirect() which does not allow redirects to external hosts. In order to get around this, we  If they’re not at checkout, we redirect them to the WooCommerce shop page. You could even use the $user variable to redirect users based on their capabilities. Redirect after Registration. To redirect after registration, you need to use the woocommerce_registration_redirect filter.

Add this filter in theme function file.

function filter_woocommerce_registration_redirect( $var ) { 
    // make filter magic happen here... 
    return get_page_link(3598); // 3598 id page id.
}; 

Add the filter:

add_filter( 'woocommerce_registration_redirect', 
    'filter_woocommerce_registration_redirect', 10, 1 );

How to redirect users to another page after Login in WooCommerce , Using a plugin to redirect users to another page after Login or Registration in WooCommerce. WooCommerce Login Redirect: This is a free  If the role is found after registration, the WooCommerce registration redirect can be initiated for that specific role. WooCommerce Redirect Users after Registration Example. Ideally, our aim is to redirect customers to a custom payment page after registration. The staff members can proceed to their account profile page after registration.

Login & Register Redirect for WooCommerce, Check out this WordPress plugin, Login & Register Redirect for WooCommerce. You can redirect your users to any URL after they log in or register with your  Using a plugin to redirect users to another page after Login or Registration in WooCommerce. WooCommerce Login Redirect: This is a free plugin that lets you redirect users to another page within your website after login or even after registration via a simple interface. In order to redirect them to a custom URL however, you will need to purchase the premium version of this plugin.

Woocommerce redirect after registration, I am trying to redirect user after Woocommerce registration I have tried everything and it is not working I have tried some methods foun After a user registers using WooCommerce's registration form, I want to redirect them to a custom page, such as my other website, instead of the my-account page. The hook above successfully redirects users when the destination is a page on the current site, but when the redirect location is off of the current site, it does not work.

How to Change the WooCommerce Login or Register Redirect URL , WP WooCommerce Redirect is a WordPress plugin to redirect your WooCommerce website Duration: 6:41 Posted: Aug 1, 2016 One of the most common WooCommerce redirects is the redirection of the user after the checkout payment. By default, they are redirected to the ‘ thank you ’ page.

Comments
  • This will fail if you deactivate Woocommerce
  • Why would you want to log the user out after registration?
  • @claytronicon We needed to implement an approval mechanism at that time. The user needed to be approved first before being able to login. wp_logout() deleted the user session directly after it was created.