Skip to:

Re: Limit users to only having one blog?

Aron Jay




Plugin name:Limit Blogs per User

Plugin Author:Brajesh K. Singh

Plugin URI:

Author URI:



add_filter(\”wpmu_active_signup\”,\”tiw_check_current_users_blog\”); //send fake/true enable or disabled request

add_action(\”wpmu_options\”,\”tiw_display_options_form\”); //show the form to allow how many number of blogs per user

add_action(\”update_wpmu_options\”,\”tiw_save_num_allowed_blogs\”);//action to save number of allowed blogs per user

/****Check ,whether blog registration is allowed,and how many blogs per logged in user is allowed */

function tiw_check_current_users_blog($active_signup)


if( !is_user_logged_in() )

return $active_signup;//if the user is not logged in,do not change the site policies


global $current_user;

$blogs=get_blogs_of_user($current_user->ID);//get all blogs of user


//if number of allowed blog is greater than 0 and current user owns less number of blogs */


return $active_signup;


return \”none\”;


/****How many blogs are allowed per user *************/

function tiw_num_allowed_blogs()


$num_allowed_blog=get_site_option(\”tiw_allowed_blogs_per_user\”);//find how many blogs are allowed



return $num_allowed_blog;//return the number of allowed blogs


/*****Show the Number of Blogs to restrict per user at the bottom of Site options ****/

function tiw_display_options_form()



<h3><?php _e(\’Limit Blog Registrations Per User\’) ?></h3>



<tr valign=\”top\”>

<th scope=\”row\”>Number of blogs allowed per User</th>


<input type=\”text\” name=\”num_allowed_blogs\” value=\”<?php echo tiw_num_allowed_blogs()?>\” />

<p>If the Value is Zero, It indicates any number of blog is allowed</p>







/**************Save the Number of blogs per user when the form is updated **************/

function tiw_save_num_allowed_blogs()


$allowed_number_of_blogs=intval($_POST[\”num_allowed_blogs\”]);//how many blogs the user has set

//save to the database

update_site_option(\”tiw_allowed_blogs_per_user\”,$allowed_number_of_blogs);//now update



You can set the number of blog you would like to allow.. its not mine, just wanna share it.. :D

– Aron

EDIT: to set the number of blogs, proceed to Site Admin/Options/ then look below..

Skip to toolbar