Header menu


Tuesday, 15 October 2013

Redirect to a url after login in wordpress/woocommerce

By default you are redirected to my account page in  wordpress/woocommerce after login.
If you want to redirect to some other url use the code below:

add_filter('woocommerce_login_redirect', 'ras_login_redirect');

function ras_login_redirect( $redirect_to ) {
     $redirect_to = "www.google.com";    

     return $redirect_to;

If you provide some value to $redirect_to you will be redirected to that url otherwise
you will be redirected to my account as due to default settings in wordpress.