How can I redirect on a url after successful registration?
You used in_array wrong. There might be some redundancy in your function too(depending on what you’re doing). You could use something like this to redirect your users: add_filter(‘login_redirect’, ‘redirect_previous_page’, 10); function redirect_previous_page(){ global $user; if ( in_array( ‘administrator’, $user->roles ) ) { return admin_url(); } else { return ‘http://localhost/’; //add your link here } }