Blog

How to import/export post details to CSV files in WordPress?

export post details to CSV files
Table of Contents

One of the most important requirements of WordPress websites is the management of posts and the ability to import and export them. If you need to export a list of posts and transfer them to another site or import this information to a new site, various methods can be used. With the help of the complete guide provided in this post, you can import and export post details to CSV files using the WooCommerce default export option, MYSQL query, and WordPress posts/pages bulk edit plugin.

Let’s review how to export WordPress posts to CSV with these methods.

Method#1: Export WordPress posts to CSV by WordPress default

The simplest and most standard way to export WordPress posts to CSV is to use the export tool in WordPress. With the help of this tool, you can easily export any post and import it on another site from the import section.

For this purpose, just follow the steps below:

  • In your WordPress dashboard, go to Tools and select Export.
  • On the Export page, enable the Posts option.
export posts to CSV in WordPress
  • Then, choose one of the below options to export post details to a CSV file.

Export WordPress posts from specific categories 

The first option in exporting WordPress post details is Categories. This is useful when you want to export some posts which are published in a specific category. 

When you open the combo box of categories, you can see a list of categories, and you can choose one of them to export the post related to it.

export posts from specific categories in WordPress

Export WordPress posts by author

Another option for WordPress export posts is Authors, which enables you to filter posts published by one of the authors and export post details to a CSV file.

export posts by author in WordPress

Export WordPress posts by date

The next option allows you to export post details to a CSV file in a date range. By choosing one of the months listed in the Start Date and Date End fields, the posts in the specified range are exported.

export posts by date in WordPress

Export a list of WordPress posts by status

If you want to filter posts based on their status, like published, scheduled, draft, etc., and export them, the last option is helpful. 

export list posts by status in WordPress

After choosing the options for filtering the posts to WordPress export posts, you need to click on the Download export file button. Then, you can see a CSV file downloaded and saved in your system.

As you may notice, the filtering options in the default export tool of WordPress are not so flexible. For example, there is no item for exporting posts by short description. It is also not possible to export a list of posts in two or more categories at once. 

To solve this problem, you need to use a powerful plugin with flexible options for filtering and exporting details to CSV files. 

Read more to get familiar with the WordPress posts/page bulk edit plugin as your ultimate solution.

Method#2: Use SQL query to WordPress export posts

If you have access to your WordPress database management system and you know how to run SQL queries, this method can work for you. We insist again, if and only if you are an expert in coding, follow the below instructions to export WordPress posts by running SQL query:

  • Back up your WordPress database to use it in case of any problem after running the Query.
  • Open PHPMyadmin by submitting the username and password of your WordPress hosting account.
  • On this page, choose MySQL, and then open the PHPMyAdmin.
  • Click on the Access PHPMyAdmin button, then click Database on the top menu to see a list of all WordPress databases.
  • Now, you need to find the database of your website, which usually starts with the name of your website.
  • Here, you can see a list of the tables within your database one of them is wp-posts
  • Wp-posts holds all of your post content, so you need to click on it to see the related rows like:
    • post revisions, 
    • titles, 
    • name,
    •  date, 
    • etc.:
SQL query to export posts in WordPress
  • You need to write down these row’s name in the mySQL query like below:
SELECT post_title, post_name, post_date, post_modified FROM
wp_posts WHERE
post_type = 'post' AND post_status = 'publish' ORDER BY post_date

Note: You can add or remove the post data based on the details you want to export.

  • Now, to run this query on your database, click on the SQL tab. 
  • Copy the above code and paste it in the empty box at the top of the page.
  • Click the Go button on the right corner of the page.
  • Finally, you need to click on the Export button in the ‘Query results operations’ section.
select export button-in query results operations section
  • Change the dropdown list of the Format field to CSV.
  • Mark Dump all rows.
  • Click the Go button and Save your export file when prompted.

By using this method, you can export WordPress posts to CSV file however, it is not possible to filter the posts and export some of them as you want.

In the next method, we are introducing the WordPress post bulk editing plugin with a lot of amazing features for filtering the exact posts that you need to export from your website.

Export WordPress post details to CSV file by WordPress posts bulk edit plugin

If you are looking for a plugin to help you export WordPress posts with flexible filtering options and easy to use interface, we recommend you use the WordPress posts/pages bulk edit plugin. Although this plugin has been designed to facilitate the process of bulk editing posts for store managers, it is possible to export a list of posts with a specific import/export button available in the main toolbar.

The good news about this plugin is that you can use a comprehensive filter form that supports all fields and meta fields of WordPress to filter a list of required posts and then export them.

Now, let’s see how.

Step 1: Download and install WordPress posts/pages bulk edit plugin 

The first step for using this awesome plugin is to download and install it on your WordPress website. 

After activating the plugin, you can see the iT Bulk Editing tab in the WordPress dashboard. Then, to have access to the Import/Export button, you need to click on the WP Posts option to see the main toolbar on the top of the posts table.

select woo posts menu in bulk editing section

Step 2: Export WordPress posts

In the main Toolbar, there are different tools available for filtering, bulk editing, and exporting posts to a CSV file. To use these tools for WordPress export posts, follow the below steps:

  • Click on the Filter icon to filter the posts you want to export.
  • Mark the posts you need to export in the table (it is optional).
  • Click on the Import/Export button to see the related form.
select filter icon and click import or export button in bulk editing plugin
  • In the import/export form, you can set one of the below options to export WordPress posts.
  • For posts:
    • All posts in the table: All posts that are shown in the table after applying the filter are exported.
    • Only selected posts: Just the posts that you have marked in the table are exported.
  • For Fields:
    • All Fields: All WordPress fields and meta fields of the filtered posts are exported.
    • Only Visible fields: Just the fields that are marked to be displayed in the table columns are exported.
  • There is also an option for choosing the export file type. You can choose either CSV or XML from the list.
  • Finally, by clicking on the Export Now button, the exported data are downloaded as CSV or XML files to your computer.
select export type field in import and export section

Now, let’s make some examples to show you how to use this plugin for exporting WordPress posts.

Export Word posts by Short description WordPress csv

Suppose that you published several posts about food, breakfast, and coffee on your website. Now you want to export those that have food in their short description.

Here, you can find how to export published posts with food in their post excerpt:

  • Open the filter form and go to the General tab.
  • Find the Post Excerpt field and choose one of the operators from the first combo box:
  • Like: To filter the posts that their short descriptions contain food.
  • Exact: To filter the posts that their short descriptions are food exactly.
  • Not: To filter the posts that their short descriptions don’t contain food.
  • Begin: To filter the posts that their short descriptions start food.
  • End: To filter the posts, their short descriptions end with food.
  • Write food in the text box.
select post excerpt field in general tab filter form
  • Go to the Date &Type tab.
  • Find the Post Status field and choose Published from the list.
select-published-option-to-post-status-field in date & type tab filter form
  • Press the Get Posts button.
  • Mark some of the posts (If you want to export selected posts).
  • Open the Import/Export form and export WordPress posts.

Export posts of specific categories in WordPress 

The steps to export WordPress posts to CSV by category are the same as in the previous example. The only difference is filtering the posts based on the categories you want.

To filter the posts by category, follow the below instructions:

  • Open the Filter Form and go to the Categories/tags/Taxonomies tab.
  • Find the Categories field and choose one of the Operators from the dropdown list, including:
    • OR: Filter posts that are assigned to one of the selected categories.
    • And: Filter posts that are assigned to all of the selected categories.
    • Not: Filter posts which are not assigned to the selected categories.
  • Open the list of categories and choose some of them, like Food and Lifestyle.
select categories field in categories tab filter form
  • Press the Get Posts button to see the list of posts in the table.
result selected categories in table

WordPress Custom post type export to CSV file

To export custom post type data, you can use the Custom type button in the Toolbar as illustrated below:

custom post type export to CSV in WordPress

By using this tool, you can see a list of all custom fields on your website and choose one of them from the list to get all custom post type lists in the table. Now, you can export all or selected posts from the table by using import/export, as we explained before.

WordPress export posts with images plugin

To export posts with images in the WordPress posts bulk editing plugin, you need to add the Thumbnail column to the table. To add or remove any columns in the posts table, you can use the Column Manager tool. By clicking on this tool, the Columns Profile form is opened, and you can mark the Thumbnail column as illustrated below:

select thumbnail option to general fields in columns profile

After pressing the Apply to Table button, you can see the posts images in the table.

Now, you can easily mark the posts you want to export in the table, then open the import/export form and use it to export the selected posts.

result thumbnail column in table

Conclusion

If you need to export post details to a CSV file, it is possible to use the default WordPress export option. In addition to exporting posts, you can use the Import option to WordPress bulk upload posts. However, if you want to filter the posts based on different fields and then export them in a CSV file, we recommend you use the WooCommerce Post Bulk Editing plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart
Sign in

No account yet?

We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Start typing to see products you are looking for.