Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
read more
Posted on November 22, 2023

The 4 Best Plugins to Import XML to WordPress

hello world!

Our article, The 4 Best WordPress Import Plugins, reviewed the best plugins for importing all or most WordPress data types. This review was based on the plugins' general features.

In this article, we examine these same plugins for use with XML import files.

There are three main criteria when assessing a plugin for XML imports:

  1. Can the plugin read an XML file directly?
  2. Can it filter the XML data?
  3. Can it modify the XML data during the import itself?

Fortunately, all of the plugins in this review can read XML files directly, so that's not an issue.

If you can't filter data during the import, you may be forced to use some kind of XML editor to delete the records you don't want, which can be a real pain.

Modifying XML data that way is an even bigger headache.

Why would you have to modify XML data during an import? In some cases, the issues are relatively straightforward. For example, you may have to reformat an incoming date or numeric value. Or you may have to combine multiple incoming data elements to create one field, such as a complete address field.

In other cases, the person sending you the data may not adhere to proper XML standards. By their very definition, XML documents are supposed to be self-defining, which means that every element should contain one value enclosed in a proper tag. But if you look at the first red box below, you'll see that the <ProductColor> element contains multiple values (blue and red) divided by a pipe ("|") character. In the second red box, the <ProductAttributes> element contains a JSON object:

Import XML WordPress - XML Elements

This may or may not be okay, depending on the field structure of the WordPress data type that you are trying to populate. If it's not okay, you'll need an import plugin that can easily parse elements containing multiple values or complex objects.

Let's see which plugins fulfill these requirements.

1. WP All Import

Import XML WordPress - WP All Import

WP All Import can handle pretty much any XML task you can throw at it.

This starts with being able to read any XML document, no matter how complex.

It also allows you to build sophisticated filters against incoming XML data with little effort. This ensures that you'll import only the records you want.

When it comes to modifying or manipulating XML data on the fly, this plugin will let you map any incoming data element to any WordPress target field, split incoming data elements into multiple fields, or consolidate multiple data elements into one field. In the following example, we've built a complete address in the Description field by dragging over multiple XML elements and combining them with literal labels and spaces:

Import XML WordPress - Map XML Elements to Fields

In this next example, we use an inline PHP string function to delete any instances of a comma in an incoming XML element:

Import XML WordPress - Inline PHP

We can modify just about any XML element this way because there are scores of PHP functions at our disposal.

If that's not powerful enough, we can build a custom PHP function right inside WP All Import's user interface:

Import XML WordPress - Embedded Function Editor

Once the function exists, we can apply it to any incoming XML element the same way we use a built-in PHP function. You can even create conditional logic in these functions!

All of these features mean that you can modify or manipulate any incoming XML element as a matter of routine.

For more information, see Import into WordPress From Any CSV, XML, and Excel.

2. Woo Import Export by Vjinfotech

Import XML WordPress - Woo Import Export

Like WP All Import, Woo Import Export has no problem reading XML files.

You can also use it to filter XML data and combine multiple XML elements into one WordPress field.

What this plugin won't let you do is modify XML elements using just the plugin's interface. Instead, you need to create PHP functions in your theme's function.php file. You can then use a shortcode to apply these functions to incoming XML elements.

Ultimately, you can achieve the same modification results as WP All Import. It's just a lot less convenient.

The other problems with this plugin are its documentation, which is much less detailed than it should be, as well as rumblings of quality issues in user reviews.

All in all, this plugin still offers a good solution. It's just not up to the same standards as WP All Import.

For more information, see Woo Import Export.

3. Ultimate CSV Importer by Smackcoders

Import XML WordPress - Ultimate CSV Importer

As with the two preceding plugins, Ultimate CSV Importer can import any XML document.

What it can't do is filter XML data, which can be highly problematic if you are sent an XML document by a third party and that document contains XML data that you don't want.

This plugin is also quite limited when it comes to modifying incoming XML data. It will let you merge multiple XML elements into a single field, and you can also apply basic formulas to numeric elements. But there is no ability to use inline PHP functions and no mechanism to apply custom PHP functions to your XML data — at least not through the interface.

This isn't necessarily a problem if you control the creation of the XML import document. But if not, you may find yourself in a situation where you have no choice but to switch to another import plugin.

To learn more, see Import All Pages, Post types, Products, Orders, and Users as XML & CSV.

4. Import WP

Import XML WordPress - Import WP

This plugin also allows you to import any XML file. It also provides a decent data filter tool.

Unfortunately, it doesn't allow you to map multiple XML elements to the same WordPress field or to split an XML element into multiple fields. Nor does it offer an embedded PHP feature like that of WP All Import.

Import WP's solution for XML data modification is instead very similar to that of Woo Import Export. If you create a PHP function in your theme's function.php file, you can then apply that function to an incoming XML element.

What makes this approach even more inconvenient than Woo Import Export is a clunky interface design. Instead of drag-and-drop data mapping, this plugin forces you to map each incoming data element to a target field using a multi-step approach. Add to this the need to use shortcodes to call functions defined in a separate PHP file, and this could make for a very cumbersome process on an import involving many XML elements.

To learn more, see Import WP – Export and Import CSV and XML files to WordPress.

Import XML into WordPress — Wrap-Up

There are two specific scenarios you should use to assess plugins that can import XML data into WordPress.

The first is a scenario where you control the creation of the XML import file. In this case, assuming you can filter and format the XML data as needed during the export process, you obviously don't need to perform the same tasks on the import side, so the differences in data filters and data modification described in this article shouldn't matter. In this scenario, you are better off choosing your XML import plugin based on its general features, which you can read about in our The 4 Best WordPress Import Plugins article.

On the other hand, if you don't have any control over the creation of the XML import file, meaning you may eventually need the ability to both filter and modify incoming data, your best choice is clearly WP All Import, as it will let you perform every aspect of these tasks right within its interface.

Your second and third options are Woo Import Export and Import WP in that order. Smackcoder's Ultimate CSV Importer plugin is not a good choice in this scenario because it lacks data filter and modification capabilities altogether.

We hope this article has helped clarify your choices.

Related Info

The 4 Best WordPress Import Plugins

The 4 Best Plugins to Import CSV into WordPress

The 4 Best Plugins to Import Excel to WordPress

Leave a Reply

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

Get Oxygen Today

Lifetime, unlimited site license

Copyright © 2024 Soflyy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram