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
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

Using XPath to Retrieve, Modify, And Filter File Elements

WP All Import uses PHP's XPath 1.0 support to allow for powerful manipulation of your data file during import. This allows you to quickly group and limit the fields that are pulled into a particular field. You can also perform simple text replacement.

Note: Most XPath statements that work directly in the SimpleXMLElement::xpath function will work in WP All Import: https://www.php.net/manual/en/simplexmlelement.xpath.php.

Note: If typing text into the import configuration with literal curly braces, the opening curly brace must be escaped with a backslash – \{something}

What is XPath?

Officially, "XPath is a language for addressing parts of an XML document...": https://www.w3.org/TR/1999/REC-xpath-19991116/

What that means in practice is that XPath is used behind the scenes in WP All Import to group and iterate through the data from your import file. Because of that, you have the opportunity to use custom XPath expressions to manipulate data during the import.

But How Do I Use It?

Say you have an import file with some image elements like this:

Use XPath to Modify Data Images Example

You could drag those elements to the Images section one by one, which is fine if you only have a few and the number of image elements remains the same:

Use XPath Drag and Drop Elements

However, what do you do if you have dozens per record, and each record could have any number of image elements? That's where the power of XPath can greatly simplify your import configuration.

Import Any CSV, XML, or Excel to WordPress

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

Here's an XPath statement that would grab all of the images, regardless of the number in each record:

{./*[starts-with(local-name(), 'image')]}


You simply place this in the Images section:

Use XPath Starts With Local Name Image

Obtain Comma-separated List with XPath

If you have multiple nodes with similar data, you can remove the [1] part of the XPath to return a comma-separated list. For example, look at this XML:

Using XPath Example Commas WP All Import

Doing this:

{images[1]/image}

Would return the following:

image_example_1.jpg, image_example_2.jpg, image_example_3.jpg, image_example_4.jpg, image_example_5.jpg

XPath Cheat Sheet

Below are some usage examples for XPath 1.0 in WP All Import.

Access One Value Based on Another

{prop[propid = '144']/value[2]}

Access One Value Based on Another (When It’s An Attribute @):

{propertyList[1]/propertyGroup[@name="COLOR"]}

Access One Value Based on Another From Different Node

{specs/spec[./name="namegoeshere"]/value[1]}
{comments/item_3[./language="fr"]/title[1]}

Use XPath Position to Control How Many Records to Import

[FOREACH({Pic[position() <= 10]})]
{.},
[ENDFOREACH]

Additional Resources

https://developer.mozilla.org/en-US/docs/Web/XPath

https://www.w3schools.com/xml/xpath_intro.asp

Related Docs

Explains how to run PHP functions in your import when using WP All Import.

Processing and Grouping Multiple Elements with FOREACH Loops.

Learn how to use IF statements with WP All Import.

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
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
$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
$999
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
cross