Login Redirect for WooCommerce

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

Customization Notes

Adjust the website URL as desired.

				
					// LOGIN REDIRECT FOR WOOCOMMERCE
add_filter("woocommerce_login_redirect", "wc_login_redirect");

function wc_login_redirect($redirect_to) {
  $redirect_to = "https://domain.com/";
  return $redirect_to;
}