1

I have a multisite instance of WordPress, and I need to add 50 existing users to each of 20 new sites.

One by one is going to take a very long time, and will send each person 20 emails confirming that they have been added to the blogs.

Is there a method I can use to easily add man existing users to a site at once ? What how about SQL statements to insert into the database directly ? I can do that if I knew which table(s) needed to be inserted.

1

2 Answers 2

3

I'd try this with two steps.

First, install the Multisite User Plugin or grab the useful bits from its code. Short version: It hooks into user_register and loops through each blog in a multisite, adding the user to each one with a preset role. Handy.

Second, use wp-cli to import a CSV of users:

wp user import-csv /path/to/users.csv

By default, this will not email users. If you want it to email users, add --send-email to the command.

Not having actually done this, I'm not sure if WordPress is going to try to send 19 emails to each user when they're added to each network site. There are plenty of email blocking plugins out there that you could engage for the import, just in case.

0

I manage multisites each with MANY subsites and many users.

I was able to add users to All (or any) subsites after adding this plugin:

https://wordpress.org/plugins/wp-multisite-user-sync/

Go to a user at the network level, click the Sync All box, all subsites instantly become automatically checked in a list.

Save the user, go look at Users the user has access to all subsites.

I love it when something (esp. plugins) do what they say they will do OOTB. Chris

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.