Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 953399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:02:44+00:00 2026-05-16T00:02:44+00:00

In WordPress MU, how can I allow users to register for new blogs with

  • 0

In WordPress MU, how can I allow users to register for new blogs with their existing account? Right now, it seems that the site admin has to manually add them at the admin page. That would be fine with me except that the admin for the entire site will have to manually add users to blogs one by one. With hundreds of blogs and hundreds of users, that could become a full time job in itself.

Or better yet, how can I cause existing users to be automatically registered under a set role for all newly created blogs under this site? That would be the holy grail of functionality for my website. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:02:45+00:00Added an answer on May 16, 2026 at 12:02 am

    I made my own plugin to do this. It may not be the most elegant code possible, but it does what I need:

    function set_user_role($blog_id,$user_id)
    {
        $users = get_users();
        // register each user to the new website.
        foreach($users as $user=>$userid)   
        {
            if($user_id == 1)
            {
                add_user_to_blog( $blog_id, $userid, "administrator" );
            }
            //auto register a new user for all previous blogs.But will this create duplicates for existing users? Nope. It doesn't! 
            else if($user_id == $userid)
            {
                //add_user_to_blog( $blogid, $user_id, "administrator" );
                $blogs = get_blogs();
                foreach($blogs as $blog=>$blogid)   
                {
                    //if this is the blog the user just created, then let them be an admin.
                    if($blogid == $blog_id )
                        add_user_to_blog( $blogid, $user_id, "administrator" );
                    else
                        add_user_to_blog( $blogid, $user_id, "subscriber" );
                }
            }
            else
                add_user_to_blog( $blog_id, $userid, "subscriber" );//if user is not an admin and not a new user, then just make them a subscriber.
        }
    }
    
    function get_users()
    {
        global $wpdb;
        $userids = $wpdb->get_col( $wpdb->prepare("SELECT $wpdb->users.ID FROM $wpdb->users ORDER BY %s ASC", $szSort ));
        return $userids;
    }
    
    function get_blogs()
    {
        global $wpdb;
        $blogids = $wpdb->get_col( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE site_id = %d  AND archived = '0'  AND spam = '0' AND deleted = '0' ORDER BY path", $wpdb->siteid));
        return $blogids;
    }
    
    //When a new blog is created, auto-register all unblocked users for it.
    add_action('wpmu_new_blog','set_user_role', 100, 2); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Websites like Wordpress and Tumblr allow designers to create themes that users can select.
I'm working on a community video site (Wordpress backbone) that will allow users to
I would like to create a website that allow users to bring/integrate their wordpress
I want in my wordpress website that user can log in through their facebook
I know that wordpress can be exported in the form of XML, but there
is there a wordpress function that I can use to detect pages? example of
it's can be apply not only to wordpress. But to all blog platform that
I am using a wordpress plugin called GD Star Rating to allow my users
I need a CMS that allow me to interact with people anonymousely... The site
I have a Wordpress MU instance installed. I allow self-registration, and self-creation of blogs.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.