WooCommerce Redirect After Registration

Recommendation

Learn why I switched to WPCodeBox for managing code snippets for myself and for my clients.

Instructions

Snippet Type: PHP

  1. Copy the snippet.
  2. Add the snippet using WPCodeBox.
  3. Follow any customization notes provided.
  4. Save the snippet.
  5. Enable the snippet.
  6. Test.

Snippet

Out of the box, WooCommerce redirects users to their Dashboard (i.e. My Account), which may not be desirable for website owners.

Customization Notes

Adjust the ‘$redirect = “https://domain.com/page-url”;’ entry to match the desired URL of your website.

				
					// WOOCOMMERCE REDIRECT AFTER REGISTRATION
add_filter("woocommerce_registration_redirect", "wcs_register_redirect");
function wcs_register_redirect($redirect) {
  $redirect = "https://domain.com/page-url";
  return $redirect;
}