My team has inherited a large WordPress Networks install. Updates need to be run and we need to communicate this to our editors and administrators. My system admin has asked me for a list of URLs and email address matched to those URLs. We plan to contact them site-by-site to manage a system wide upgrade.
What would be an efficient way to go about this?
I can get a list of emails from the wp_users
table. Is there a tool that does this already (and properly)?
Most importantly: How can I group these users to their individual WP sites in the Networks install?
In other words, how might I get a report like this from within the WP-Admin? My client would like to use a plug-in if possible to produce this report inside of the admin interface.
site one
- smellyPete
- bilboBaggins989
site two
- sallysue997
- billyBob
etc, etc
This should do the trick. Read along with the comments for some explanation.
There’s
get_users()
— you could use it in conjunction with the results of a$wpdb
query along the lines of$wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" );
If I’ve got all that right, then at the end,
$list
should be an array of the formatReferences
Codex:
get_users()
get_blogaddress_by_id()
Make backups before attempting anything.
Phpmyadmin, SQL tab, then: “Run SQL query/queries on database”:
OR if you’re not comfortable with SQL:
Select wp_users
“Check All”
Query results operations
Export
Then select MS Excel or CSV and further edit until you’re left with user login, nicename, email, and user_url.
That should be sufficient enough to make contact
If you not want to use any script then you can use wordpress plugin Export Users to CSV.This can export ALL user data and meta data, and that works!
You can even export the users by role and registration date range.
Features:
I have no idea if there are any plugin allowing this, but if you don’t mind using a bit of SQL you can extract it this way:
This will produce the following resultset:
where ID, user_login, user_email, user_registered and display_name are user’s details while path is the subsites URL (you might want to select domain instead of path if your network install is domain based and not directory based)
Note that this will produce one row per site where the user is registered, which means that if you have a user registered as an admin on one site and as an editor on the other, the query will produce 2 rows for this user.
Using GROUP_CONCAT you can concatenate all these rows into one:
This will produce the following resultset:
Initiate console/terminal
Analyze results