User Registration

Step by step documentation to set up a user registration form for your website.

How to redirect to a specific page after login?

To redirect users to a specific page after login, you can simply add the redirect URL parameter in the login form Shortcode.

The redirect_url parameter allows you to redirect to a certain page after the user is logged in. E.g. [user_registration_my_account redirect_url=”https://yoursite.com/page-to-redirect”] will redirect to the sample page after logging in.

add_filter( 'user_registration_login_redirect', 'ur_redirect_after_login', 10, 2 ); 
function ur_redirect_after_login( $redirect, $user ) { 
     return 'sample-page' ;
}  
Having trouble with adding custom codes to your site? Check this.

Powered by BetterDocs

Scroll to top