WordPress filter hook

woocommerce_login_redirect

Defined by WooCommerce and fired by 17 plugins in total, running on 12.1M+ sites between them.

“This filter is documented in woocommerce/includes/class-wc-form-handler.php”

How to use woocommerce_login_redirect

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_login_redirect', function( $redirect, $user ) {
	// Change $redirect here.
	return $redirect;
}, 10, 2 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

17 plugins that fire woocommerce_login_redirect

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) includes/class-wc-form-handler.php:1268
  2. Site Kit by Google icon Site Kit by Google5+ million installs apply_filters( 'woocommerce_login_redirect', $redirect_to, $user ) includes/Modules/Sign_In_With_Google/WooCommerce_Authenticator.php:70
  3. Hide My WP Ghost icon Hide My WP Ghost100,000+ installs apply_filters( 'woocommerce_login_redirect', $page_name ) models/Uniquelogin.php:474
  4. SysBasics Customize My Account for WooCommerce icon SysBasics Customize My Account for WooCommerce7,000+ installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) include/wcmamtx_extra_functions.php:80
  5. SMS Alert icon SMS Alert3,000+ installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) handler/forms/class-wplogin.php:464
  6. WholesaleX icon WholesaleX2,000+ installs apply_filters( 'woocommerce_login_redirect', wc_get_page_permalink( 'myaccount' ), $user ) includes/class-wholesalex-shortcodes.php:3303
  7. SiteFort Security icon SiteFort Security100+ installs apply_filters( 'woocommerce_login_redirect', $redirect_to, $user ) modules/Auth/Auth.php:278
  8. ETBS Account Guard icon ETBS Account Guard60+ installs apply_filters( 'woocommerce_login_redirect', remove_query_arg( 'wc_error', $redirect ), $user ) inc/class-acgd-two-step.php:2120
  9. UFP Identity icon UFP Identity30+ installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) identity-woocommerce.php:48
  10. Logliy icon Logliy10+ installs apply_filters( 'woocommerce_login_redirect', $result['redirect'], $user ) includes/email-otp.php:209
  11. GetOTP OTP Verification icon GetOTP OTP Verification10+ installs apply_filters( 'woocommerce_login_redirect', remove_query_arg('wc_error', $redirect), $user ) public/class-getotp-public.php:1112
  12. Anar Toolkit icon Anar Toolkit10+ installs apply_filters( 'woocommerce_login_redirect', $url, $user ) src/Integrations/WooCommerce.php:151
  13. SMSGELY icon SMSGELYFewer than 10 installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) includes/otp/class-auth.php:84
  14. Chat On Desk Order Notifications icon Chat On Desk Order NotificationsFewer than 10 installs apply_filters( 'woocommerce_login_redirect', $redirect, $user ) handler/forms/class-wplogin.php:491
  15. HappyAccess icon HappyAccessFewer than 10 installs apply_filters( 'woocommerce_login_redirect', $target, $user ) src/Features/TwoStep/Challenge.php:1649
  16. Balui Security Suite icon Balui Security SuiteFewer than 10 installs apply_filters( 'woocommerce_login_redirect', remove_query_arg( array( 'wc_error', 'password-reset' ), $r ), $user ) includes/class-login.php:420
  17. Single Page Shopping icon Single Page ShoppingFewer than 10 installs apply_filters( 'woocommerce_login_redirect', remove_query_arg( 'wc_error', $redirect ), $user ) includes/class-awcs-form-handler.php:360

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.