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

Real-Time Exports API Integration Example

Using our real-time export feature, WP All Export can generate an export every time a new record of the chosen post type is created on your site. Each record is exported one by one, in real-time, as they are created. The record data can be used programmatically with our API and custom code.

Once you've set up a real-time export, you'll also need to set up an action that will be triggered for each exported record.

This guide explains how to use our API to set up that action. The code will use our API to send an HTTP POST request every time a WooCommerce order completes on your site. That request will include a JSON payload with the order data.

Please note that this is only example code that will most likely require modifications. For example, you may need to encode the order payload differently, or you may want to log/store errors from the cURL request in a different fashion. This specific example works strictly for CSV exports.

Step 1: Use the pmxe_after_export Hook

To get started, we are going to use the pmxe_after_export hook, which is going to fire after any export execution. We define for which specific export ID the code will run, so it's only executed for our real-time export.

 
function send_order_data_post_request( $export_id, $exportObj ) {
	// Run for export 3 only
	if ( $export_id == '3' ) {
		// Integration code here
	}
}
add_action( 'pmxe_after_export', 'send_order_data_post_request', 10, 2 );

Step 2: Define URL to Send the Post Request

Now, we define the URL that we are going to use for the POST request.

 
		//The url you wish to send the POST request to
		$url = "http://www.example.com/tester.phtml";

Step 3: JSON Encode the Order Data you Want to Send

We proceed to JSON encode the order data. We use a default CSV export for this example.

First, we obtain the current CSV export file from $exportObj->options["current_filepath"]. Then, we use the array_map function with the str_getcsv function as the callback to build an array that contains the exported data. This array is later encoded as a JSON in the $payload variable.

 
		//JSON encode the order data that was exported
		$csv = file_get_contents($exportObj->options["current_filepath"]);
		$array = array_map("str_getcsv", explode("\n", $csv));
		array_pop($array); //Used to remove an empty element at the end of the array.
		$payload = json_encode($array);

Step 4: Open the Connection

This initializes the cURL session.

 
		//Open the connection
		$ch = curl_init();

Step 5: Set the URL, Enable POST Request, Add POST Data

Using the curl_setopt function, we define the URL to be fetched with CURLOPT_URL, we set CURLOPT_POST to true to make a regular HTTP POST request, and then attach the $payload to the request with CURLOPT_POSTFIELDS.

 
		//Set the url to be fetched
		curl_setopt($ch,CURLOPT_URL, $url);
		//Enable regular HTTP POST request
		curl_setopt($ch,CURLOPT_POST, true);
		//Pass the order data payload
		curl_setopt($ch,CURLOPT_POSTFIELDS, $payload);

Step 6: Execute HTTP Post Request via cURL

We execute the HTTP POST request via cURL using curl_exec.

 
		//Make sure curl_exec returns the contents of the cURL; rather than echoing it
		curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 

		//Execute HTTP post request via cURL
		$result = curl_exec($ch);

Step 7: Return Error if cURL Fails and Close the Connection

In case there are any errors, we catch them using the curl_errno function and return them.

Finally, we proceed to close the cURL session using curl_close.

 
		// Return error if cURL fails.
		if ( curl_errno( $ch ) ) {
			exit( 'Error:' . curl_error( $ch ) );
		}
		//Close the connection
		curl_close( $ch );

Export WordPress to any CSV, XML, or Excel

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

Full code example

This is what the full code would look like:

 
function send_order_data_post_request( $export_id, $exportObj ) {
	// Run for export ID 3 only
	if ( $export_id == '3' ) {
		//The url you wish to send the POST request to
		$url = "http://www.example.com/tester.phtml";
		
		//JSON encode the order data that was exported
		$csv = file_get_contents($exportObj->options["current_filepath"]);
		$array = array_map("str_getcsv", explode("\n", $csv));
		array_pop($array); //Used to remove an empty element at the end of the array.
		$payload = json_encode($array);
		
		//Open the connection
		$ch = curl_init();

		//Set the url to be fetched
		curl_setopt($ch,CURLOPT_URL, $url);
		//Enable regular HTTP POST request
		curl_setopt($ch,CURLOPT_POST, true);
		//Pass the order data payload
		curl_setopt($ch,CURLOPT_POSTFIELDS, $payload);

		//Make sure curl_exec returns the contents of the cURL; rather than echoing it
		curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 

		//Execute HTTP post request via cURL
		$result = curl_exec($ch);
		
		// Return error if cURL fails.
		if ( curl_errno( $ch ) ) {
			exit( 'Error:' . curl_error( $ch ) );
		}
		//Close the connection
		curl_close( $ch );
	}
}
add_action( 'pmxe_after_export', 'send_order_data_post_request', 10, 2 );

If your order export columns look like this:

Order Data API Export Example

The JSON-encoded payload with the order data would look like this:

 
[["Order ID","Order Key","Title","Order Total","Product Name","Quantity","Item Cost","Shipping Taxes","Coupons Used"],["297","wc_order_Z5Y3gvVG79Tec","Order - October 20, 2022 @ 04:21 AM","18.51","Blue Circle Dog Tag from Aibox","1","17.31","1.2",""]]

Related Docs

Learn how to set up and run real-time exports using WP All Export.

Review our API to learn about the available hooks.

Use WP All Export to generate an export file manually, or on a schedule.

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