---
title: "How to Export WordPress Comments to CSV or Excel"
url: "https://wpimportexport.com/how-to-export-wordpress-comments-csv-excel/"
description: "Export WordPress comments to CSV or Excel, filter by post and status, preserve reply references, and repeat the workflow with an AI agent."
type: post
published: 2026-10-26T08:57:16+00:00
modified: 2026-11-14T10:47:55+00:00
categories: ["Export Guides"]
tags: ["AI Agents", "CSV Export", "Excel", "WordPress Comments"]
docs_topics: ["Export guides"]
---

# How to Export WordPress Comments to CSV or Excel

To export WordPress comments to CSV or Excel, open **Import Export by RockStarLab → Export**, choose **Comments**, set the selection, choose your columns and download the file. Use a Post ID filter when you need the discussion attached to one particular post. Include parent-comment identifiers if replies matter.

A useful comment export contains more than the message text. It tells you which post the message belongs to, whether it is approved, when it was submitted and whether it answers another comment. Those details make the file usable for a moderation report, an editorial review or preparation for a migration.

This guide covers CSV and Excel exports, comments from a specific post, moderation statuses and threaded replies. You can follow the steps in WordPress or use an AI agent.

## Decide what “all comments” means

The default selection includes approved and pending comments. Select spam or trash explicitly when you need those records. Use a Post ID filter to limit the export to one discussion.

| What you need | Selection to prepare |
| --- | --- |
| Comments across the site | Remove the Post ID filter; check the available count and comment types. |
| Discussion on one post | Post ID (source/local fallback) → Equals → the post’s actual ID. |
| Publicly approved feedback | Add Status → Equals → 1. |
| Moderation queue | Add Status → Equals → 0. |
| Spam or trash archive | Choose the corresponding status explicitly; verify its count separately. |
| Product reviews with ratings | Use the dedicated WooCommerce Reviews workflow. |

The general Comments option and product reviews overlap at the WordPress data level, but they serve different reporting needs. For rating columns and product references, follow [the WooCommerce reviews export tutorial](https://wpimportexport.com/how-to-export-all-woocommerce-reviews/). Do not assume that a site-wide comment export contains only blog discussions.

## Prepare a small, checkable selection

Start with a post whose discussion you can inspect. In this example, **Trail Planning Discussion** has post ID **1917**. Replace this example ID with the ID from your own website.

| Comment | Status | Relationship | Default post export |
| --- | --- | --- | --- |
| 37 — Alex Demo | Approved | Top-level comment | Included |
| 38 — Sam Demo | Approved | Reply to comment 37 | Included |
| 39 — Jamie Demo | Pending | Top-level comment | Included |
| 40 — Morgan Demo | Spam | Top-level comment | Excluded |
| 41 — Taylor Demo | Trash | Top-level comment | Excluded |
| 42 — Casey Demo | Approved | Attached to a different post | Excluded |

To find your post ID, open the post editor and inspect the `post=` number in its address, or use a known post ID from your content inventory. A title is useful for humans, but two posts can have the same title. Use the actual ID for a precise selection on the current site.

Basic comment export is available in the Free plugin. Transformations and other premium operations have separate edition requirements.

## 1. Choose Comments in the export wizard

1. Open **Import Export by RockStarLab → Export**.
2. Select the **Comments** content type.
3. Click **Next Step** to open the filters.

Use the plugin’s Export screen for this workflow. WordPress also has its own Tools → Export screen, which is a different interface and output workflow.

## 2. Export comments from a specific post

1. Click **Add Filter**.
2. Choose **Post ID (source/local fallback)**.
3. Keep the condition **Equals**.
4. Enter the current site’s post ID.
5. Wait for **Total Items Available** to refresh before continuing.

For post 1917, the count settled at three. The count can briefly show the preceding selection while a request completes; read the final value after the filter update. If needed, use the refresh button beside the count.

![Comment export filtered by Post ID 1917 with three available items](https://wpimportexport.com/wp-content/uploads/2026/10/comments-01-post-filter.webp)

_The Post ID filter selects the discussion attached to one specific post._

### Export comments across all posts instead

Remove the Post ID filter to export across posts. Review any remaining status, type, date or content filters: removing one condition does not remove the others.

### Choose approved or pending comments

Add a Status condition when moderation state matters. Approved comments use `1`; pending comments use `0`. Choose `spam` or `trash` explicitly for those status groups.

Keep the Status column in the output so the selection is easy to understand later. Review the available count after changing filters.

## 3. Choose fields that preserve context

In **Select Fields**, build the export structure from Available Fields. Use the category-level **Add all** controls for Basic, Dates, Hierarchy and Related Post to reproduce the 16-column example, or choose fewer columns for a focused report.

![Selected comment export fields including identifiers, status, dates and parent references](https://wpimportexport.com/wp-content/uploads/2026/10/comments-02-fields.webp)

_Keep post references and parent-comment IDs so the exported text retains its context._

| Fields | Why keep them? |
| --- | --- |
| comment_ID, source_comment_id | Identify each exported comment and provide source references for a compatible downstream workflow. |
| comment_post_ID, source_post_id | Identify the source post. These are not automatically destination-site IDs. |
| post_title, post_slug, post_permalink, post_type | Make it possible to recognize and locate the related content. |
| comment_content | The saved message text, including punctuation and line breaks. |
| comment_approved, comment_type | Explain moderation state and the kind of comment. |
| comment_date, comment_date_gmt | Keep the stored local and GMT timestamps distinct. |
| comment_parent, source_comment_parent_id | Retain the link from a reply to its source parent. |
| comment_karma | An additional stored field included by the Hierarchy group; optional for most reports. |

Author Name and Author Email are available in the Author group. The example leaves those columns out because they are unnecessary for checking message text and relationships. Add author details when the intended report needs them. Similarly, an IP address or user agent should not be included simply because it is available.

### Replies are rows with references, not nested cells

The example reply has `comment_ID=38` and `comment_parent=37`. Its source parent field also contains 37. The top-level messages contain zero in the parent fields. Sorting a worksheet by date or text changes row order but should not change these identifiers.

A filtered file can contain a reply without its parent, for example when the parent falls outside a reporting period. That does not automatically mean the exporter lost data. Check the selection before treating a missing parent row as an error. For migration, preserve the necessary parent comments and plan how source post references will be matched on the destination.

## 4. Choose CSV or Excel and download

Select **CSV** for a portable text file. Keep the comma delimiter for this example and enable **First row contains column names**. Give the file a descriptive name without the extension; the plugin adds the format extension. The `{job_id}` placeholder helps distinguish repeated exports.

![CSV export options with comma delimiter, header row and a descriptive filename](https://wpimportexport.com/wp-content/uploads/2026/10/comments-03-csv-format.webp)

_The header row identifies the columns; the job ID distinguishes this export from later runs._

Click **Start Export**, wait for the completion screen and use **Download Export File**. Compare the exported count with your selection before opening the file.

![Comment export completed with three exported items and a download button](https://wpimportexport.com/wp-content/uploads/2026/10/comments-04-completed.webp)

_The completion count is a useful first check; inspect the actual file before using it._

Choose **XLSX** for an Excel workbook. Enable the header row to include column names. For an AI-agent export, set `format_options.spreadsheet_include_header` to `true`.

A comment containing a comma, a quotation mark or a line break still belongs in one cell. Use a CSV-aware reader instead of counting physical text lines. In Excel, import a CSV with the intended encoding and delimiter if opening it directly puts all values into one column. XLSX avoids the delimiter choice, but it does not remove the need to verify the selection.

Download the demonstration output as [CSV](https://wpimportexport.com/static/wordpress-comments-export-sample.csv) or [XLSX](https://wpimportexport.com/static/wordpress-comments-export-sample.xlsx). Both contain the same three example comments and header columns. The post URLs and IDs refer to the demonstration site; they are examples, not live destination references.

## 5. Verify the export against WordPress

1. Count data rows separately from the header.
2. Compare the comment IDs with the intended source selection.
3. Check the related post ID and title.
4. Read at least one reply and confirm its parent reference.
5. Check pending versus approved statuses.
6. Inspect punctuation, accented text and a multiline message.
7. Confirm that comments from other posts are absent.

Open the source Comments screen and compare it with the file. Look for the original message, its replies and any pending comments. WordPress lists spam and trash in separate status groups.

![WordPress comments screen showing two approved comments, one pending comment and a reply to Alex Demo](https://wpimportexport.com/wp-content/uploads/2026/10/comments-05-source.webp)

_The source UI confirms the exported discussion, including the reply relationship and separate moderation groups._

Compare message text, dates, post references, statuses and parent IDs. Include a multiline comment in your checks so a line break is not mistaken for an extra record.

## Export comments with an AI agent

Connect the intended WordPress site using the [Abilities API and MCP setup guide](https://wpimportexport.com/how-to-use-the-wordpress-abilities-api-with-ai-agents-exports-imports-content-sync-and-backups/). Ask the agent to discover the available abilities and read their current schemas. Avoid copying credentials, temporary download links or local file paths into public prompts.

An agent can use `rsl-ie/get-content-schema`, `rsl-ie/export-count`, `rsl-ie/export-preview`, `rsl-ie/export-start`, `rsl-ie/job-get` and `rsl-ie/file-get`. Use `export_type: comment` and set `options.post_id` to the intended post ID.

### Prompt: inspect the selection

```
On the connected WordPress site, find the post titled Trail Planning Discussion.
Confirm its ID rather than assuming a match from the title alone.
Discover the comment export abilities and read the current schemas.
Count and preview its comments. Report approved, pending, spam and trash
separately, and explain which statuses the default selection includes.
Do not change any posts or comments.
```

### Prompt: create the file

```
Export the reviewed comment selection to XLSX.
Include comment IDs, source IDs, post references, content, status,
comment type, local/GMT dates and parent-comment references.
Enable the spreadsheet header row explicitly. Omit email, IP and user-agent
columns. Use a descriptive filename and a unique request ID.
Poll the returned job until it completes, then obtain its download link.
Do not start a duplicate export just because one response is delayed.
```

### Prompt: verify the result

```
Compare the exported file with the reviewed source comments.
Check IDs, row count, post IDs, statuses, message text and parent references.
Check quotes, accented characters and multiline text.
Open the source Comments screen in the browser to verify the discussion.
Report mismatches; a completed job alone is not sufficient evidence.
```

Retrieve the download link after the job completes. Save the file you need; a temporary export link is not a permanent public sample URL.

## Common problems and practical fixes

| Problem | What to check |
| --- | --- |
| Zero comments exported | Confirm the post ID belongs to this site, then review remaining filters and moderation status. |
| Fewer rows than the total in the database | Compare approved, pending, spam and trash separately. Check type and post restrictions. |
| Replies look disconnected | Include parent identifiers and check whether the parent was excluded by a filter. |
| Excel shows no column names | Enable the spreadsheet header option. The first data row is not a header. |
| CSV appears in a single column | Import it with the delimiter chosen during export. |
| More text lines than comments | Multiline comment content can span physical lines inside a quoted CSV field. |
| Product reviews appear in a broader export | Review comment type selection; use the dedicated review exporter for rating reports. |
| A source post ID points to something else after migration | Source IDs are local references. Use a verified import mapping instead of assuming IDs match across sites. |

## Use the file for the right job

Keep the original export unchanged and work on a copy when sorting, annotating or removing columns. For an editorial report, group feedback by post and moderation status. For a migration, keep the source references and test the destination mapping before moving a full discussion.

A comment spreadsheet is not a complete website backup. Use the [WordPress backup and restore guide](https://wpimportexport.com/how-to-create-a-wordpress-website-backup-and-restore-it/) when you need a recovery copy. For other data workflows, browse the [written documentation](https://wpimportexport.com/import-export-video-tutorials-for-wordpress/#written-guides).

## Frequently asked questions

### Can I export comments from just one WordPress post?

Yes. Add a Post ID filter using the actual ID on the current site, then verify the available count before exporting.

### Does the default export include spam and trash?

The default selection includes approved and pending comments. Select spam and trash explicitly when needed.

### Can I export WordPress comments to Excel?

Yes. Choose XLSX. Enable the header option when you want field names in the first row.

### Are replies preserved in the export?

Replies are separate rows. Include comment IDs and parent-comment references to retain their relationships.

### Does exporting change comment moderation status?

Exporting reads the selected comments without changing their moderation statuses.

### Do I need author emails in the file?

No. Choose author fields only when the intended report needs them. Our example omits email and IP columns.

### Can an AI agent export comments?

Yes. An agent can count and preview comments, start an export, poll the job and retrieve the file through the plugin abilities.

### Can I use this export as a full website backup?

No. It contains the selected comment data, not a complete backup of the website, files and settings.
