Sub Site logins and Registrations doing strange things

When I try and register a new account from a subdomain site.. ex.
It takes me to
Process should be.. User registers and is taken back to the subsite they registered through.
So I should end up back at :

Also if I try and Login to using the Login Option in the site meta.
It brings up the login form.. I enter details.. then it takes me to the main site
(And shows me as Not logged in)
If I then return to I will be logged in.

Shouldn't I be able to just login to the network through

Am I missing something here?



  • Sajid

    Hi Adeon,
    Hope you are doing good today!

    For user registration, every user must be redirected to main site and specially to checkout page if you have enabled signup on checkout option of Pro Sites. So that behaviour is correct.

    For login redirect to subdomain after login, try adding following code in functions.php file of your child theme or use it as mu-plugin.

    function login_site_redirect ( $redirect_to ) {
    	global $user;
    	$primary_blog_id = get_usermeta($user->ID, 'primary_blog');
    	$blog_details = get_blog_details($primary_blog_id);
    	$redirect_url = $blog_details->siteurl;
    	return $redirect_url;
    add_filter ( 'login_redirect', 'login_site_redirect', 10, 3 ) ;

    If you take the mu-plugin route, you'll want to log into your site via FTP, and go to your /wp-content/ folder via FTP, finding the folder called "mu-plugins".

    If there's no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like (making sure the file has an extension of .php, e.g. example.php) and paste the code in there.

    It'll always be active, so there's no need to activate the plugin after creation. Be sure to add a PHP start tag at the beginning of the code, like this:


    For not login issue on main or other site, try using the following plugin for Single Sign On (SSO) across the network.

    If you are using our Domain Mapping plugin then you don't need to use above plugin because it has built in option of SSO.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,