Tricks, Wordpress

How to add hundreds of random WordPress users quickly

Sometimes you might need to add hundreds of wordpress users quickly to test out your wordpress site.
You can follow this method to do that:

    1. A general users account

For your domain, select any common email address say common@yourdomain.com. You will be using this same email address for all user accounts.
Can be anything – like say gmail address. Can also be a fake email. But it’s better to have an actual one.

    1. Install WordPress plugins

For this to work, you’ll need 2 wordpress plugins:

      • Allow Multiple Accounts Plugin

This plugin will allow you to have multiple user accounts using same email

Plugin:
https://wordpress.org/plugins/allow-multiple-accounts/

Go to settings of this plugin and in the textbox: Multi-account email addresses

type your common email address: common@yourdomain.com

      • Add Multiple Users Plugin

https://wordpress.org/plugins/add-multiple-users/

This plugin helps add multiple user accounts using a csv.

Now in WordPress left panel go to AMU — Plugin Settings

Uncheck “Send each new user a registration notification email?”
Section “CSV Column Ordering”:
In “Choose which method of column ordering you would like to use:” select “Predefined Below”
In “Predefined column order to use when importing CSV data (no spaces, separate with commas):”

Just add:

first_name,last_name,user_login,user_pass,user_email,role

Then do “Save Settings”

    1. Create random usernames

Get a random name generator php script here:
https://tricksty.com/tricks/php-script-generate-random-usernames

Modify the email address, password, total no of usernames to be generated etc in this script and run it.
You can generate hundreds or thousands of users as per your liking.

It will echo out a comma separated list of user account details like this:

Angelo,Slyton,aslyton75,password,common@emailaddress.com,Editor
Lloyd,Silbert,silbert39,password,common@emailaddress.com,Editor
Terisa,Hiciano,thiciano55,password,common@emailaddress.com,Editor
Milagro,Munerlyn,munerlyn66,password,common@emailaddress.com,Editor

Copy this text.

    1. Add users to WordPress

Now in WordPress left panel go to: AMU — Import CSV data
Paste your generated csv text here and click on “Next Step”.
If you want to see all users in a form before inserting users then click on “Create User Information Form”
And then do “Add All Users”
But if you have too many users then this can take time. So instead you could just do:
“Skip form and add users”. You can always delete the users later on and re-add as per your need.

If the RandomNameGenerator php script ever gives a duplicate username, then AMU plugin will give error:
“Error: a user with this user_login already exists. This user was not registered.”
and not register the user.

Let me know in the comments below if you have any issues with this.
Or any other easier method you might have to do this 🙂
Peace.

Leave a Reply

Your email address will not be published. Required fields are marked *