WooCommerce Redirect After Registration
Building better MyListing websites. One code snippet at a time.
Overview
The WooCommerce Redirect After Registration code snippet allows for greater flexibility within a MyListing website.
Out of the box, WooCommerce redirects users to their Dashboard (i.e. My Account), which may not be desirable for website owners.
Implementation
- Grab the code snippet.
- Follow the provided instructions.
- Save your changes.
//// INSTRUCTIONS:
//// Copy and paste the code snippet below into the child theme's functions.php file.
//// You can edit the functions.php file from your WordPress dashboard (Appearance > Theme Editor) or via FTP.
//// NOTES:
//// Adjust the website URL in line 13.
--------------------------- CODE SNIPPET IS BELOW THIS LINE ---------------------------
// WOOCOMMERCE REDIRECT AFTER REGISTRATION
add_filter("woocommerce_registration_redirect", "wcs_register_redirect");
function wcs_register_redirect($redirect) {
$redirect = "http://your-website-page.com/";
return $redirect;
}