WooCommerce Registration Redirect

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution. If you would like to redirect the user to a custom page, you will need the post ID of said page.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About this Solution

By default, when a user registers and creates an account on your WooCommerce website, they are redirected to their dashboard on the My Account page. This guide shows you how to change this and redirect the user to any page you like. We’ve also included a handful of most popular pages including how to redirect the user to: Home Page, Shop Page, Cart Page, Checkout Page, and any custom post or page, upon registration. Simply comment-out/un-comment the appropriate redirect you would like in place. For the custom page redirect, you will need the post ID of said page. To get the post ID, simply edit that page and the URL will show you the integer ID. Alternatively, you can hover over the post in the backend editor where you “Quick Edit” posts and you’ll see the ID there too. This particular example redirects the user to the homepage upon WooCommerce Account Registration.

				
					/**
 * Snippet Name:	WooCommerce Registration Redirect
 * Snippet Author:	ecommercehints.com
 */

add_filter( 'woocommerce_registration_redirect', 'ecommercehints_registration_redirect', 10, 1 );
function ecommercehints_registration_redirect( $redirection_url ){
    $redirection_url = get_home_url();									// Home page
	// $redirection_url = get_permalink( wc_get_page_id( 'shop' ) );	// Shop Page
	// $redirection_url = wc_get_cart_url();							// Cart Page
	// $redirection_url = wc_get_checkout_url();						// Checkout Page
	// $redirection_url = get_permalink( 12 ); 							// Custom Page (The ID of the post/page you would like to redirect to - replace '12')
    return $redirection_url;
}
				
			

Snippet Benefits

  • Redirect the user to a custom page upon WooCommerce account registration
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

Your email address will not be published. Required fields are marked *

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers