Index of /andrejciho/Wordpress MU/Username not the same as blog address

Post Title Posted Description
Back Parent Directory
Username not the same as blog address 2006-10-28 14:10

How annoying that creating new blog also makes a user with the same name.


When you create a new blog in WordPress MU (mutli-user), it asks you for blog address, blog title, and admin email. When you submit the form, along with a new blog being created, also a new user is created with matching username (username = blog address). Not everybody likes it that way and with the following 5 minute modification, you can create blogs where the username is not the same as the blog address.

First, add a username field to the form where you create blogs.
(./wp-admin/wpmu-blogs.php)

Right above this line: (in my file it’s line 567):


insert this line:


Then to receive/process the variable after you submit the
form, edit the file that processes the form.
(./wp-admin/wpmu-edit.php)

In the case ‘addblog’, right below this line:

$blog = $_POST['blog'];

Insert this line:

$username = wp_specialchars($blog['username'] );
Then change the line that says

$user_id = wpmu_create_user($domain, $password, $email );

to this:

$user_id = wpmu_create_user( $username, $password, $email );

That’s it!


Comments (2) to “Username not the same as blog address”

  1. Hey, I don’t know if you have had a chance to look at version 1 yet of MU, but when you sign up it asks for a username instead of a blog name. You can then set your blog name once your in the backend

  2. I didn’t have a chance to download and try the real 1.0 – I’ve only been working with RC1 of 1.0. The main point of the functionality I’ve added is that you can decide what the person’s blog name will be as opposed to letting them decide that. It is useful for some settings such as a university hosting blogs / porfolios for students.

This website is powered by Wordpress