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 19, 2023

The 4 Best Plugins to Import CSV into WordPress

hello world!

In our article The 4 Best WordPress Import Plugins, we examined the best plugins to import WordPress data in terms of general features.

In this article, we reexamine those same plugins when importing data from a CSV file.

Since all four plugins can import CSV files (it's the most common import/export file format), what is there to talk about?

If all CSV data followed the simple format of Value 1, Value 2, Value 3, etc., there wouldn't be anything to discuss. But this isn't the case. For example, a single CSV data element can contain multiple data elements divided by a secondary separator character:

  • Value 1, Value 2a | Value 2b, Value 3

Here, the 2nd data element in the CSV file has been split into two values separated by the pipe ("|") character.

In other scenarios, an incoming data element may contain more complex information, such as a JSON object. Or it may contain data that needs to be reformatted, such as date value that needs to be converted into a specific date format.

The question, then, is not whether these four plugins can import CSV files. It is whether they have the built-in tools needed to address layout and format issues found in the CSV data itself.

Let's get started!

1. WP All Import

Import CSV into WordPress - WP All Import

This plugin can handle any CSV layout variations you can throw at it. It can map any incoming data element to any target field. It can split incoming data elements into multiple target fields, or consolidate multiple data elements into one target field. It also lets you combine literal values with the incoming data:

Import CSV into WordPress - Field Mapping

Additionally, you can modify the format of any incoming CSV data element through the use of inline PHP functions:

Import CSV into WordPress - Inline PHP

In this case, we're using the PHP str_replace() function to remove any instances of a comma inside an incoming data element. There are scores of PHP functions available that allow you to do just about anything with a value.

Still not enough? WP All Import also provides an embedded function feature that allows you to make far more complex changes. Here, we've created a custom function to round a dollar amount:

Import CSV into WordPress - Embedded Function Editor

As you can see by the use of the "if" clause inside the function, you can even create conditional logic that can change its behavior depending on the circumstances that you define.

Once a custom function exists, you can apply it to any relevant incoming data element just as you would a built-in PHP function.

When it comes to CSV files, this means that there are no limits to your ability to modify incoming values during an import just by using the features that WP All Import has built directly into its interface. You can't ask for any more than that!

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

2. Woo Import Export by Vjinfotech

Import CSV into WordPress - Woo Import Export

Woo Import Export's ability to modify CSV data during an import is similar to that of WP All Import in terms of combining multiple incoming data elements into one field. But it has several notable shortcomings:

  • You cannot use inline PHP functions, so splitting an incoming data element into multiple target fields is not possible using this method;
  • The plugin does not provide an embedded function feature that lets you modify CSV data in more sophisticated ways, at least directly through the interface;

What Woo Import Export does provide is a shortcode mechanism that allows you to call PHP functions that you have already added to your theme's function.php file. This lets you achieve the same end result as the interface features provided by WP All Import but with considerably less convenience and more maintenance.

With WP All Import, you can build & test modification code directly within the interface, with no need to tamper with theme files. Even if you update your theme files or change your theme, this modification code will continue to work. It's also self-documenting in that you can use the interface to see the applicable code in the context of its use.

With Woo Import Export, you must build the functions in the function.php file first, then test/use them in your import process. If you update or modify your theme, you're the one responsible for ensuring that the import code is reapplied to the new or updated function.php file.

For more information, see Woo Import Export.

3. Ultimate CSV Importer by Smackcoders

Import CSV into WordPress - Ultimate CSV Importer

Ultimate CSV Importer is even more limited than Woo Import Export when it comes to modifying incoming CSV data elements. It does allow you to merge multiple data elements into a single field. You can also apply basic formulas to numeric fields. But there is no ability to use inline PHP functions and no mechanism to apply custom PHP functions to incoming data CSV data elements — at least not through the interface.

This means that if you receive a CSV file from a third party, and that file is not already perfectly formatted, you will most likely have to manually edit it prior to importing it. This, of course, rules out any possibility of scheduling your import to run automatically.

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

4. Import WP

Import CSV into WordPress - Import WP

This plugin is the weakest of the four when it comes to modifying CSV data elements. It does not allow you to map multiple incoming data elements to the same target field or to split incoming data elements into multiple fields. You also can't apply PHP functions to incoming data elements.

What it does let you do is define PHP functions in your theme's function.php file, which you can then apply to incoming data elements via a shortcode — the same approach used by Woo Import Export. Unfortunately, this brings with it the same inconvenience and code maintenance drawbacks, too.

This isn't a showstopper, but it is worth a pause if CSV imports are an important part of your business.

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

Import CSV into WordPress — Wrap-Up

Handling CSV imports in WordPress isn't always as simple as it's made out to be. Sometimes, suppliers send you data that needs to be modified in some way before you can use it in your system. When this happens, you have two options:

  • Manually edit the file to make it compliant with your requirements;
  • Automate the modifications so that they occur every import without you having to perform any manual tasks;

Most people prefer the second option. If you want to schedule your CSV imports to run automatically, this isn't just a preference — it's a necessity!

The best plugin to handle such modifications in WordPress is unquestionably WP All Import. It allows you to make every conceivable kind of modification directly through its interface with zero additional maintenance or admin tasks.

The rest of the plugins on this list all involve some kind of compromise. Ultimate CSV Importer supports a couple of simple modifications through the interface but fails to provide any mechanism to perform more sophisticated changes.

Woo Import Export and Import WP do provide a way of performing more advanced modifications, but it's not exactly convenient and comes with some code maintenance overhead.

We hope this article has at least clarified your WordPress CSV import options.

Related Info

The 4 Best WordPress Import Plugins

The 4 Best Plugins to Import Excel to WordPress

The 4 Best Plugins to Import XML 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