# How to export email addresses from WordPress comments > **Warning:** a comment is not permission to send marketing email. The standard WordPress comment form asks for a name, email address and website, and offers to save them in the browser, but it collects no consent to receive newsletters. In the UK, PECR does not allow marketing email to individuals unless they have specifically consented, apart from a narrow exception for existing customers. In the US, CAN-SPAM requires every marketing email to explain clearly how to opt out. Other countries, including those in the EU, have their own rules. Only add commenters to a mailing list if they explicitly opted in, for example with a newsletter checkbox on your comment form, and keep a record of that consent. This is not legal advice: check the rules that apply to you before you send anything. WordPress stores the email address of everyone who leaves a comment. Exporting those addresses is useful for replying to readers, running a survey among people who agreed to be contacted, or moving commenters who opted in to your email tool. This guide shows four ways to export them: with a plugin, with WP-CLI, with an SQL query in phpMyAdmin, and with the built-in WordPress export. **Before you start:** you need an Administrator account on the site. For the manual methods you also need access to the site’s database (phpMyAdmin, usually through your hosting control panel) or to WP-CLI on the server. ## Choose a method | Method | Output | Best for | | --- | --- | --- | | Comments Import & Export plugin | CSV file | Non-technical users who want a spreadsheet | | WP All Export Pro (paid) | CSV or XML file | Custom columns and filters | | WP-CLI | List in the terminal, which you can save to a file | Developers with server access | | phpMyAdmin (SQL) | Query results you can copy or export | Anyone with database access and no plugins | | **Tools** > **Export** | WordPress XML (WXR) file | A full backup, not an email list | ## Export with the Comments Import & Export plugin [Comments Import & Export](https://wordpress.org/plugins/comments-import-export-woocommerce/) by WebToffee exports comments to a CSV file. 1. In WordPress, go to **Plugins** > **Add Plugin**, search for “Comments Import & Export”, then install and activate it. 2. Go to **Comments** > **Comments Im-Ex**. The export form is under **Export Comments in CSV Format**. 3. Set the export options: - **Limit**: the number of comments to export. Leave it empty for no limit. - **Date**: a date range, from **From date** to **To date**. Leave it empty to export comments from any date. - **Articles**: the posts whose comments you want. Leave it empty to include all posts. - **Delimiter**: the character that separates columns in the CSV file. The default is a comma. - **Columns**: tick the columns to include. For an email list you need at least `comment_author_email`. `comment_author`, `comment_post_title` and `comment_date` add useful context. 4. Click **Export Comments**. The plugin downloads a CSV file of the selected comments. ![The Comments Import & Export plugin's Export Comments in CSV Format screen, with fields for Limit, Date, Articles and Delimiter, and a Columns list in which comment_author_email and the other columns are ticked](https://workover.io/api/proxy-image?url=https%3A%2F%2Fwp.wpdocsync.com%2Fwp-content%2Fuploads%2F2026%2F08%2Ff8de4fc1-89d4-4883-8d07-aef733fa448e-how-to-export-email-addresses-from-wordpres.png) The export includes approved comments and comments still waiting for moderation, but not spam or trash. Remove the pending ones, and any duplicate addresses, before you use the list. ## Export with WP All Export Pro [WP All Export](https://wordpress.org/plugins/wp-all-export/) by Soflyy exports WordPress data to CSV or XML, but exporting comments needs its paid Pro edition. If you choose **Comments** in the free plugin from wordpress.org, it shows “WP All Export Pro is Required to Export Comments.” 1. Install and activate WP All Export Pro. 2. Go to **All Export** > **New Export**. 3. Leave **Specific Post Type** selected and choose **Comments** from the dropdown. The plugin shows how many comments are available to export. ![WP All Export New Export screen with Specific Post Type selected and the post type dropdown open on Comments, above a count of 327 Comments and an Add Filtering Options section](https://workover.io/api/proxy-image?url=https%3A%2F%2Fwp.wpdocsync.com%2Fwp-content%2Fuploads%2F2026%2F08%2Fe80cb5e5-43d2-4359-9ef6-3cff5791d48e-how-to-export-email-addresses-from-wordpres.png) 1. To export only some comments, for example approved ones, add a rule under **Add Filtering Options**. 2. Click **Customize Export File**. 3. Add the comment author’s email address to the export columns, along with any other columns you want. 4. Continue through the remaining screens, click **Confirm & Run Export**, then download the file. ## Export with WP-CLI If you have shell access to the server and [WP-CLI](https://wp-cli.org/) is installed, run this from the WordPress directory: ``` wp comment list --status=approve --field=comment_author_email | sort -u > commenter-emails.txt ``` This lists the email address of every approved comment, `sort -u` removes duplicates, and the result is saved to `commenter-emails.txt`. Comments with no email address, such as pingbacks, can leave a blank line at the top of the file. Delete it before you use the list. ## Export with phpMyAdmin > **Warning:** you are working directly in your site’s database. The query below only reads data, but a mistyped query elsewhere can change or delete content. Back up the database first. 1. Sign in to your hosting control panel and open **phpMyAdmin**. 2. In the list on the left, click the database your WordPress site uses. 3. Click the `wp_comments` table. Your table prefix may differ from `wp_` if it was changed during installation, for example `wpx_comments`. 4. Click the **SQL** tab at the top. 5. Paste this query. If your prefix is not `wp_`, change `wp_comments` to match. ``` SELECT DISTINCT comment_author_email FROM wp_comments WHERE comment_author_email <> '' AND comment_approved = '1' AND comment_type IN ('comment', ''); ``` The `comment_author_email` column is never NULL in WordPress (an empty address is stored as an empty string), so the query filters on `<> ''`. It also keeps only approved comments, which leaves out spam, trash and comments waiting for moderation, and it leaves out pingbacks and trackbacks. 1. Click **Go**. 2. Below the results, under **Query results operations**, choose how to get the addresses out: - **Copy to clipboard**, then paste into a spreadsheet or text file. - **Export**, which opens an export page where you choose a format, such as CSV, and download the file. - **Print**, to print the results from your browser. ![phpMyAdmin showing the wp_comments table query results as a single comment_author_email column of example addresses, with arrows pointing to Print and Copy to clipboard under Query results operations, next to Export](https://workover.io/api/proxy-image?url=https%3A%2F%2Fwp.wpdocsync.com%2Fwp-content%2Fuploads%2F2026%2F08%2Fdb3561e4-cd73-4e72-bf7a-2b1f0d67a38a-how-to-export-email-addresses-from-wordpres.png) ## The built-in WordPress export **Tools** > **Export** creates a WordPress XML (WXR) file of your content, and comments in that file include the commenter’s email address. It is not a CSV file and is not meant for mailing lists, so use one of the methods above if you want a clean list of addresses. ## Keep the list safe An exported list of email addresses is personal data. Store it somewhere access-controlled, share it only with people who need it, and delete working copies (CSV files in your downloads folder, clipboard pastes) once you have imported the addresses where they belong. ## Next steps Import only the addresses of commenters who opted in into your email tool, such as Mailchimp, Constant Contact or Brevo (formerly Sendinblue). Once they are in, you can group readers, for example by the topics of the posts they commented on, and send each group related content. If you want more commenters to join your list, add an explicit, unticked newsletter checkbox to your comment form, so the consent is recorded at the moment the address is collected.