Risk Free, Backed By Our 90-Day Money Back Guarantee
 - 
Read More
Lifetime Licenses Are Ending Soon, Get Yours Before They're Gone
 - 
Read More
Risk Free, Backed By Our 90-Day Money Back Guarantee
Pricing

You may have seen some references on our site to annual licensing or renewals.

All plugins currently come with a lifetime license, no matter what the site says.

We’re currently running tests before we make the switch to annual pricing. Check the Discounts tab to purchase our other plugins and get a lifetime license before they’re gone.

I Understand I Have a Lifetime License
Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
Read More
200,000+ Active Installs
1500+ 5 Star Reviews
Docs Menu

The best import export plugin for WordPress & WooCommerce.

Complete, granular control of your data with an easy to use drag & drop interface.
  • 90 Day Money Back Guarantee
  • Unlimited Installs
  • Lifetime Licence
  • Fast, World-Class Support
Get Started
90 Day Money Back Guarantee

How to Customize Your WordPress Export with WP_Query

WP_Query is a WordPress class that allows you to fetch posts directly from the database. It's powerful enough for developers to perform extremely complex queries, but simple enough for a regular WordPress user to learn.

You can learn more about WP_Query and all of its parameters here: https://developer.wordpress.org/reference/classes/wp_query/

Rather than writing these WP_Query expressions by hand, you can use https://generatewp.com/wp_query/ to create them for you.

Using WP_Query in WP All Export

Go to All Export › New Export and select the WP_Query Results option. Then, select the query type from the drop-down. All of the custom post types available for export are added here automatically. In our default install, there are three options:

  • Post Type Query
  • User Query
  • Comment Query

These options use WP_Query, WP_User_Query and WP_Comment_Query.

In this example, we're going to choose Post Type Query.

Post Type Query

Building the Query

The most basic query would include a post type and a post status. For example, to get all published posts in the default WordPress "Posts" post type, the query would be:

"post_type" => "post",
"post_status" => "publish"
Simple Posts Query

Alternatively, you could export all Media Library items like images and attachments with this query:

"post_type" => "attachment", "post_status" => "inherit"

If you need to define multiple post types and multiple post statuses, you can use arrays. For example, you can get all pages and posts that are either pending, published, or drafts with the following query:

"post_type" => array( "post", "page" ),
"post_status" => array( "publish", "draft", "pending" )
Query multiple post types and statuses

Advanced WP_Query Examples

The WP_Query class has the ability to do custom field queries, taxonomy queries, author checks, and much more. There's no way that we can cover all of the possibilities in this article, but here, we'll cover some more advanced queries just to showcase the power of this feature.

Export WordPress Data to any CSV, XML, or Excel

  • Any theme or plugin
  • Images & galleries
  • Custom fields
  • Zapier integration
  • Woo, ACF, Meta Box, JetEngine

Specific criteria for WooCommerce Products

For this example, we'll export a set of variable WooCommerce products with the following rules:

  • Product must be published.
  • Stock value is higher than 0.
  • Products are sorted by title in ascending order.

The query:

"post_type" => array( "product", "product_variation" ),
"post_status" => "publish",
"orderby" => "post_title",
"order" => "ASC",
"meta_query" => array( array(
     "key" => "_stock",
     "value" => 0,
     "compare" => ">"
) )

Custom Post Type Search

For this example, we'll search all posts in the post type properties added by a real estate theme. The criteria:

  • Post type is properties
  • Status is publish
  • Author ID is 3, which is a real estate agent
  • The property has the For Sale category assigned to it
  • Custom field _featured is set to 1, making it a featured property in the theme

The query:

"post_type" => "properties",
"post_status" => "publish",
"author" => 3,
"tax_query" => array( array(
     "taxonomy" =>      "property_category",
     "field" => "slug",
     "terms" => "for-sale",
) ),
"meta_query" => array( array(
     "key" => "featured",
     "value" => "1",
     "compare" => "=",
) )

Limit Posts to Export Example (WP Query + PHP Function)

If you need to limit the number of posts exported, you can use a custom PHP function inside of a WP_Query Results export.

To learn more about using PHP functions in exports, see How to Pass Exported WordPress Data Through PHP Functions.

You'll need to insert the following into either your child theme's functions.php file or a plugin like Code Snippets:

function example_get_those_ids($post_type = 'post', $number_of_posts = 5, $order = 'ASC', $post_status = 'publish', $order_by = 'ID') {

	$query = get_posts(
		array(
			'post_type' => $post_type,
			'numberposts' => $number_of_posts,
			'order' => $order,
			'orderby' => $order_by,
			'post_status' => $post_status,
			'fields' => 'ids'
		)
	);

	return ( !empty($query) ) ? $query : array();

}

To call the function, you must pass five parameters:

  1. The post type (e.g., "post").
  2. The number of posts to export (e.g. "5").
  3. Whether they should be in ascending or descending order (e.g., "ASC" for the first X number of posts, "DESC" for the last X number of posts).
  4. The post status (e.g., "publish").
  5. How the posts should be ordered (e.g., ID, date, etc.)

For example, to export the last three pages that were published, you need to use the following:

"post_type" => "page",
"post_status" => "publish",
"post__in" => example_get_those_ids("page", "3", "DESC", "publish")

Or, to export the last five orders in WooCommerce that have a status of "Completed", you'd use the following:

 "post_type" => "shop_order", 
"post_status" => "wc_completed", 
"post__in" => example_get_those_ids("shop_order", "5", "DESC", "wc_completed")

See:

WP Query PHP Function Example

Related Docs

Execute custom code to modify the export data on the fly.

Use filters to tell WP All Export which data should be exported specifically.

Client Mode allows you to give access to other user roles to run/download specific exports.

The best import export plugin for WordPress & WooCommerce.

Complete, granular control of your data with an easy to use drag & drop interface.
  • 90 Day Money Back Guarantee
  • Unlimited Installs
  • Lifetime Licence
  • Fast, World-Class Support
Get Started
90 Day Money Back Guarantee

Unlimited Installs.
World-Class Support. Money Back Guarantee.

Packages
Standalone
Import
Pro Package
$199
.00
/yr
Save $494, 71% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$693 If Purchased Individually
Buy Now
90 Day Money Back Guarantee
Import + Export Pro Package
$299
.00
/yr
Save $1087, 78% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$1386 If Purchased Individually
Buy Now
90 Day Money Back Guarantee
WooCommerce Import Package
$169
.00
/yr
Save $29, 15% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$198 If Purchased Individually
Buy Now
90 Day Money Back Guarantee
Lifetime License
$1299
One-Time Payment
  • Import Pro + Export Pro
  • All Current Add-Ons
  • All Future Add-Ons
  • Lifetime Support
  • Lifetime Updates
  • No Renewal Fees
Buy Now
90 Day Money Back Guarantee
Import Standalone
$99
.00
/yr
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee
Import + Export Standalone
$169
.00
/yr
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee
Export Standalone
$99
.00
/yr
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee
Packages
Standalone
Import
Pro Package
$16.58
per month, billed annually
Save $494/yr, 71% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$693/yr If Purchased Individually
Buy Now
90 Day Money Back Guarantee
Import + Export Pro Package
$24.92
per month, billed annually
Save $1087/yr, 78% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$1386/yr If Purchased Individually
Buy Now
90 Day Money Back Guarantee
WooCommerce Import Package
$14.08
per month, billed annually
Save $29/yr, 15% Discount
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
$198/yr If Purchased Individually
Buy Now
90 Day Money Back Guarantee
Lifetime License
$1399
One-Time Payment
  • Import Pro + Export Pro
  • All Current Add-Ons
  • All Future Add-Ons
  • Lifetime Support
  • Lifetime Updates
  • No Renewal Fees
Buy Now
90 Day Money Back Guarantee
Import Standalone
$8.25
per month, billed annually
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee
Import + Export Standalone
$14.08
per month, billed annually
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee
Export Standalone
$8.25
per month, billed annually
  • Import Pro
Import Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
  • Export Pro
Export Add-Ons
  • Woo
  • ACF
  • Meta Box
  • JetEngine
  • Gravity Forms
  • Users
Buy Now
90 Day Money Back Guarantee

Unlimited Installs.
World-Class Support. Money Back Guarantee.

Developer
Pro features to get your WordPress data moving
Normally $299/yr
$149
.00
/yr
Save $150
Import & Export Pro
  • Posts Types, Pages & Taxonomies
  • Custom Fields & Meta Support
  • WordPress Users Support
  • Gravity Forms Entries
  • Developer Tools
  • Pro Settings
  • See detailed list of features
    Buy Now
    90 Day Money Back Guarantee
    Professional
    Everything you need to import and export anything
    Normally $599/yr
    $299
    .00
    /yr
    Save $300
    All Features & Integrations
  • WooCommerce
  • Bulk Editing & Data Migration
  • Advanced Custom Fields
  • JetEngine
  • Meta Box
  • Manual Scheduling
  • See detailed list of features
    Buy Now
    90 Day Money Back Guarantee
    Unlimited Lifetime
    All features and integrations forever for unlimited sites
    Normally $1599
    $1299
    .00
    once
    Limited-Time Offer
    ONE-TIME PAYMENT 
  • Import Pro + Export Pro
  • All Current Features & Integrations
  • All Future Features & Integrations
  • Lifetime Updates
  • Lifetime Support
  • No Renewal Fees
  • See detailed list of features
    Buy Now
    90 Day Money Back Guarantee

    Risk Free with our Money-Back Guarantee

    We would love for you to try WP All Import. Our 90-day money-back guarantee means that if you decide our plugins don’t meet your needs, just let us know, and we’ll gladly give you a full refund, no questions asked.
    200,000+ Active Installs
    1500+ 5 Star Reviews
    Developer
    $149
    .00
    /yr
    Buy Now
    Professional
    $299
    .00
    /yr
    Buy Now
    Ultimate Lifetime
    $1299
    Buy Now
    Unlimited Lifetime Package Features
    included in only in the Ultimate Lifetime Package
    One-Time Payment. No Renewal.
    All Future Add-Ons
    Developer Package Features
    included in all packages
    Untilimited Site Activations
    World-Class Support
    Import & Export Custom Post Types, Pages & Taxonomies
    Import & Export Custom Fields & Meta
    Download Import File from URL & FTP
    Export to CSV, XLSX, and XML
    Import & Export Filters
    Import & Export WordPress Users
    Import & Export Gravity Forms Entries
    Delete Missing Records on Import
    Run PHP Functions on Imports & Exports
    Choose Which Data to Update
    WP_Query Exports
    Secure Client Mode for Exports
    Zapier Integration for Exports
    Professional Package Features
    everything the Developer package, plus:
    Import & Export WooCommerce Products
    Import & Export WooCommerce Product Galleries
    Import & Export WooCommerce Orders
    Import & Export WooCommerce Customers
    Import & Export WooCommerce Reviews & Coupons
    Sync WooCommerce Stock & Prices
    Import & Export ACF Fields
    Import & Export JetEngine Fields
    Import & Export Meta Box Fields
    Export to Google Merchant Center
    Migrate Data Between Sites
    Bulk Edit with Export, Edit, Import
    Manual Scheduling for Imports & Exports

    Have any questions? 

    These are some of the most frequent questions we get about how to get data imported to or exported from WordPress

    Can I use any file type to import my data?

    Absolutely. It doesn't matter how big your CSV file is or what your column names are. Just use our Drag and Drop interface to map incoming data elements to their target fields, and you'll be done in minutes.

    Can I import Excel or Google Sheets to WordPress?

    Yes. Importing any spreadsheet is straightforward. Need to import Google Sheets to WordPress? Just copy and paste its URL. Need to import into WordPress from Excel? Same thing!

    How does my WordPress import data need to be organized?

    Our plugin is extremely flexible, so you probably won't have to make any changes to your data. You can try your WordPress import right now, and if you have any issues, we'll be glad to help you out.

    What will my WordPress export file look like?

    Unlike other solutions, our plugin gives you complete control over your WordPress export, including how it's formatted. You can modify fields, merge them together, and even create completely custom fields using embedded PHP.

    How do I export WordPress data to CSV?

    To export data to a CSV file, you don't have to do anything at all, as CSV is our default export format. If you want to export to other file formats, just change the export type in the Drag & Drop screen.

    Can I export WooCommerce products?

    Yes. Our software is completely integrated with WooCommerce. It provides full support to export WooCommerce customers, orders, products, variations, attributes, subscriptions, and reviews.
    cross