How to Import WordPress Comments
To import WordPress comments, go to All Import › New Import, provide your import file, and map the incoming data elements to the relevant WordPress comment fields. Run the import, then verify that the new data is correct.
Table of Contents
- Step 1: Create a New Comments Import
- Step 2: Review the Import File
- Step 3: Map Data to the Target Fields
- Step 4: Run the Comments Import
Step 1: Create a New Import for WordPress Comments
Navigate to All Import › New Import on your site, provide your import file (upload, download, or select it), then choose Comments from the dropdown list:
Click Continue to Step 2.
Step 2: Review the Import File
The Review Import File screen appears next. Here, check that your import file and data are correct:
Near the bottom, you can use the Manage Filtering Options section to apply filters to the import data, which you to narrow down which comments to import.
Click Continue to Step 3.
Step 3: Map the Incoming Data Elements to the Correct Fields
Next, you will see the Drag & Drop screen, which allows you to map the data elements from your import file to their corresponding Comments target fields. To do so, drag the import elements from the right side of the screen to their target fields on the left.
First, map the Comment itself, then the Parent Post it's attached to (with post ID, slug, or post title), then the Comment Date:
The Advanced Options section lets you define Approval Status, Comment Type, Karma, and Parent Comment (matched by comment ID or date/time of parent in GMT time).
This section lets you map the Author Name and Author Email:
There are additional advanced options in this section that let you map the Author User ID, Author IP, Author URL, and Comment Agent:
This section lets you add custom fields or meta to your comments:
Below, you may see other sections depending on your installed add-ons, as well as the Function Editor at the end.
Click Continue to Step 4.
Step 4: Configure the Import Settings and Run the Import
You now see the Import Settings screen, where you can define key import settings. To start, click Auto-detect to generate a unique identifier for the imported comments. This allows our software to identify duplicates and properly apply updates.
Below this, you'll see the Scheduling Options and Configure Advanced Settings sections. These can be left with their default selections for this example.
Click Continue at the bottom to move to the next step.
This brings you to the Confirm & Run interface, where you can review an import summary explaining what will happen. Click on Confirm & Run Import to proceed.
Once the import completes, you'll see this screen:
Check and view the comments after you import the WordPress comments.
Import WordPress Comments – Advanced Topics
Comment Skipped Due to Post Match Not Found
If a comment is skipped because no post parent is found, you'll see a message like this in the History Logs:
[01:44:36] SKIPPED: Comment post not found by id `Hello world!`
To solve this, you need to check that there's a valid post matching the post ID, title, or slug that you're using. Comments can only be imported when they have a matching post.
Learn more about importing WordPress posts here: How to Import WordPress Posts.
Use Filters to Select What Comments to Import
You can filter the comments to import during Step 2 or when editing the existing import template under Manage Filtering Options. To create a filter, you need to specify an Element, a Rule, and a Value.
In this screenshot, we've created a rule that will only import comments where the parent post ID has a value equal to 8.
To change a filter for an existing import, locate that import in All Import › Manage Imports, go to Edit Template, and modify the filters in Manage Filtering Options.
You can learn more here: Filtering with XPath.
Import WordPress Comments – Frequently Asked Questions
How Do I Enable Comments for WordPress?
- Go to Settings › Discussion in the main WordPress menu.
- Check the Allow people to submit comments on new posts option.
- Configure options in the Other comment settings section.
- Configure options in the Before a comment appears section.
- Configure options in the Comment Moderation section.
- Enter restricted comment words in the Disallowed Comment Keys section.
- Save your changes.
Note, comments can also be allowed or disallowed for individual posts or pages.
How Do I Export Comments from WordPress?
- Navigate to All Export › New Export.
- Choose Comments as the export post type.
- Set any desired filters.
- Select the export columns using the Drag & Drop screen.
- Run the export and download the export file.
How Do I Export All Comments from WordPress?
- Go to All Export › New Export.
- Select Comments as the export type.
- Do NOT set any export filters. This ensures that you will export all comments.
- Choose the export columns.
- Run the export and download the export file.
To learn more, see How to Export WordPress Comments.
How Do I Bulk Edit My Existing Comments?
- Create an export for the existing comments.
- Download the export file.
- Edit the export file in your favorite spreadsheet.
- Import the modified file using the Import with WP All Import option.
- Verify that the changes were correctly applied.
This requires you to have both WP All Import and WP All Export. Learn more about bulk editing data here: How to Bulk Edit WooCommerce and WordPress Data.
How Do I Migrate Comments From One Site to Another?
- Create an export with the desired comments.
- Download the export bundle file, which includes import instructions.
- On the destination site, go to All Import › New Import and upload the bundle file.
- Run the import.
- Verify that the comments were migrated as expected.
For this to work, the posts should match by title, as that's what is used in the bundle file. Learn more about this process here: How to Migrate WooCommerce and WordPress Data.
Import WordPress Comments – Related Docs
Learn how to export WordPress comments.
Learn how to import any file into WordPress.
Step-by-step instructions on how to import WordPress posts.
Learn how to use PHP code during your import to modify data on-the-fly.