Forums

Mass User Creation in WordPress 3.0 (4 posts)

  1. Ady
    Member
    Posted 1 year ago #

    I am trying to find a way to create many users at a time in a wordpress 3.0 single site blog.

    the idea is to allow us to contact our members when a new newsletter is available or to notify them of a new event coming up

    as there are over 150 members it would take me too long to create them all, so a quick fix would be very helpful.

    Any ideas?

  2. Otto
    Tech Ninja
    Posted 1 year ago #

    If you don't mind writing a bit of code, it's easy to create users.

    <?php
    require( '/wp-load.php' );
    wp_create_user('otto', 'password', 'otto@ottodestruct.com');
    wp_create_user('fake', 'fakepass', 'fake@example.com');
    ... and so on ...

    Just make a php file in the main blog directory that looks like that and run it one time. Delete it after the users are created.

    Function call looks like this:
    wp_create_user($username, $password, $email);

    Alternatively, just edit the database directly. For the passwords, use the MD5 hash of the password in the database field. That hash will get converted to something more secure after they log in the first time.

  3. tomhermans
    Member
    Posted 1 year ago #

    I'm gonna need something similar, thanks for the pointer Otto.

    @Ady, tomorrow or the day after that I'll be probably done with this, I'll post the solution here.

    grtz,
    ToM.

  4. Joel
    Member
    Posted 1 year ago #

    I also noticed that wordpress "salts" passwords after the first login... but still lets you use a standard MD5 hash the first time... which is a huge benefit for automatically creating users.

    I would imagine Otto's script could be made to add the same "salting" hash by plugging into the wp_salt() function?

    Thoughts?

Topic Closed

This topic has been closed to new replies.

About this Topic