The WP_Query Export feature in WP Ultimate CSV Importer allows you to export WordPress data using your own custom query. You can export any specific posts, selected user roles, or filtered comments. This method gives you complete control using the same query structure that developers already use in WordPress development.
This guide will walk you through the full process, step by step.
How to Export with WP Query #
Step 1: Go to the WP Query Export section #
In your WordPress dashboard, go to Ultimate CSV Importer > Export. There you’ll find two export methods. Click the WP QUERY tab.
Step 2: Choose your query type #
You’ll see a dropdown labeled Query Type. Select one of the following options:
- Post Type Query – To export posts, pages, products, or any custom post type.
- User Query – To export WordPress users.
- Comment Query – To export comments.

Step 3: Enter your query #
In the Query Argument box, write your query in a JSON-like format. Here are some examples:
1. To Export published blog posts use the query #
“post_type” => “post”,
“post_status” => “publish”
Where “post_type” => “post” – Exports standard blog posts
and “post_status” => “publish” – Only includes published posts in the export.

Please note: the query format should be like this:
- Use double quotes for both the key and value.
- Don’t wrap the entire query in array() or {}.
- Use => to assign values to keys.
- Add commas for multiple conditions
- Avoid using a comma after the last line.
2. To Export subscribers, use the query #
“post_type” => “user”,
“role” => “subscriber”
Make sure you’ve chosen the query type as user query.

3. To Export approved comments for post ID 45 #
Choose ‘comment query’ from the query type and enter the below query.
“post_type” => “type”,
“post_id”: 45,
“status”: “approve”

After entering your query, click the Continue button.
Step 4: Fill in export settings #
You’ll now be taken to the export setup page after you’ve entered the query successfully. Here’s what you need to do:
- Enter a File Name for the export file.
- Choose a File Type like CSV, TSV, JSON, XLS, XLSX, or other.
- Click the Export button.

The plugin will now process your query and generate the export file.
Step 5: Download your exported file #
Once the export is complete, you’ll see a Download link. Click Download and save the exported file to your computer.

That’s it! You’ve successfully exported WordPress data using WP_Query.

WP Ultimate CSV Importer Pro
Get Ultimate CSV/XML Importer to import data on WordPress faster, quicker and safer.
What You Can Export with WP Query #
Depending on the query type you choose, you can export Posts, Pages, and Custom Post Types (e.g., WooCommerce products, orders), WordPress Users (any role), and Comments (with filters like status, post ID, or author).
Note: This feature does not support JetEngine CCT at the moment.
Below are the supported query types and arguments.
Supported Query Types & Arguments #
1. Posts (WP_Query) #
Use this to filter and export specific post types like blog posts, WooCommerce products, or any custom post type.
Available Arguments:
- post_type: post, page, or custom types like product, shop_order, etc.
- post_status: publish, draft, pending
- author, author_name
- category_name, tag, taxonomy slugs or IDs
- p, post__in, post__not_in
- orderby, order
- meta_key, meta_value
- s: search term
- posts_per_page, paged, offset
2. Users (WP_User_Query) #
Filter users based on role, ID, metadata, or search terms.
Available Arguments:
- role: subscriber, administrator, etc.
- meta_key, meta_value
- include, exclude: user IDs
- search: by login, email, etc.
- number, paged: for pagination
3. Comments (WP_Comment_Query) #
Export comments with fine-tuned control—filter by post ID, user, status, and more.
Available Arguments:
- post_id, user_id
- status: approve, spam, etc.
- type: comment, pingback, trackback
- author_email, meta_key, meta_value
- orderby, order
- number, offset, parent, date_query

WP Ultimate CSV Importer Pro
Get Ultimate CSV/XML Importer to import data on WordPress faster, quicker and safer.