Last updated

WordpressMu: Don’t allow new blogs

If you’re using WordpressMu, the blog hosting tool used on Wordpress.com, you may want to disable the creation of blogs by your visitors.

Whatever your reasons for this are, I wanted to prevent this, because I (and my team of editors) want to maintain several blogs on different topics. Users are free to register and post comments, but creating new blogs is reserved for the administrator.

So, how do you implement this in WordpressMu? There is no checkbox (yet) that disables this feature. So, I had to hack the WordpressMu code a bit.

First, open up wp-signup.php. If you access a blog that does not exist, you’ll be redirected to the signup page and be presented a signup form for that particular blog.

Open up wp-singup.php en just above the get_header(); call, place the following code:

1if (!is_user_logged_in() || $user_identity != 'admin') {
2    header("Location: http://example.com/gofishatthispage/");
3    exit();
4}

What this does is make sure that only a logged in user named ‘admin’ is allowed to proceed to the blog creation form. Others will be redirected to a location of your choice. A good idea is to send people to a page that explains why they can’t’ create a blog or what they have to do to get an administrator to create one for them.