Skip to main content

WordpressMu: Don’t allow new blogs

·213 words·1 min· ·
General Everything Features WordPressMu
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

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:

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

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.

Related

Migrate SQLite3 to MySQL easily
·275 words·2 mins
General Everything RubyOnRails Databases Features
Tagging in ajax_scaffold
·468 words·3 mins
General Everything Web Development RubyOnRails Features
Generate a SQlite-based Rails app
·187 words·1 min
General Everything RubyOnRails Databases SQlite Features