Redirect to created blog after signup of new blog

I have my wp network setup so that existing members can register blogs, and there are no mail activation.
I am looking for a way to redirect users to the blog they have created, instead of showing the text:"The site xxxxx is yours.
xxxxx.net/xxxxxx is your new site. Log in as “admin” using your existing password."
is it possible to do this in functions.php or as a MU plugin?

  • Jude
    • DEV MAN

    Hey Bjorn

    Hope all is well with you !

    This should be possible, take a look at the snippet below.

    function wporg_wpmu_new_blog_redirect( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
    wp_redirect( get_site_url( $blog_id ) , 200 ) ;
    exit;
    }
    add_action( 'wpmu_new_blog', 'wporg_wpmu_new_blog_redirect', 10, 6 );

    You'd want to put that into a mu-plugin.

    Cheers
    Jude

  • Bjorn
    • Site Builder, Child of Zeus

    I do not see any difference when I create user blogs.
    this is the full code I have used in the MU plugin:

    <?php
    function wporg_wpmu_new_blog_redirect( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
    wp_redirect( get_site_url( $blog_id ) , 200 ) ;
    exit;
    add_action( 'wpmu_new_blog', 'wporg_wpmu_new_blog_redirect', 10, 6 );
    }
  • Bjorn
    • Site Builder, Child of Zeus

    It still dont redirect. But it is not a big deal, I can use the deafault behavour of wp-signup.
    I am more focusing on a loading animation while building new blog temlates blog.
    I have a different support tread for that. I think the redirect option can wait until I have the loading solution ready..

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.