May
3
2020

Exporting all user email addresses in WordPress

By default, WordPress’ export tool (under Tools > Export in WordPress’ admin panel) doesn’t have an option to allow you to export all of your users’ email addresses. This guide shows you how to export all user email addresses in WordPress.

There are many reasons you as a website owner might want to do this, of course, but if you’re planning to add them to a mailing list, beware data protection laws in your local region.

1. Use an export plugin for WordPress

There are plenty of WordPress plugins which can help you export data from your website, including user email addresses. We’ve used the Import Export WordPress Users plugin with success before, and it is still (as of May 2020) actively maintained.

The Import Export WordPress Users plugin allows you to download all of your WordPress website’s users, including their email addresses, in CSV (comma-separated value) format. You can then open this in spreadsheet software such as  OpenOffice Calc, Microsoft’s Excel, or Google’s Sheets tool, and capture the email addresses.

2. Export from the database directly

This method to export your users’ email addresses from WordPress will only apply if you have direct access to the database of your website – this might be accessible through a range of tools in your website hosting’s cPanel or Plesk control panel, or via a tool called phpMyAdmin.

No matter which database tool you are using, navigate to the users table in your WordPress website’s database. The name of this table may have a prefix if you have one set in your website’s wp-config.php file, so it may look something like wp_users or yoursite_users.

Export this database table in CSV format, which you can then open in any spreadsheet software such as those listed above.

3. Use MySQL to list all user email addresses

Finally, you can also use the following MySQL query (which we’ve adapted below) on your database to return all WordPress user’s email addresses. You may need to adapt this query to match the name of your WordPress users’ table.

SELECT user_email FROM wp_users;

Still need some help exporting data from your WordPress website? Our talented WordPress developers are available for hire!