Wait!

Lifetime licenses are only available for a short time, don't miss out!

Any File Type

No need to reorganize your data, just upload your file to WP All Import and it'll sort it out.

Complete Customization

Granular control over every single piece of data. Think your import is too complicated? Think again.

Import Huge Datasets

It doesn't matter how big your site is or how much data you need to import, WP All Import can handle it. 

Multilingual Imports

Importing data to multilingual sites has never been easier, with support from the WPML team.

Scheduled Imports

Run imports automatically on a schedule. Subscribe to our point and click scheduling service, or set up cron jobs.

Developer Friendly

Write and test PHP right inside WP All Import when setting up your import, with tons of snippets to get you started.
@glitzformals
"This plugin is a game changer for my situation. I’m stunned at how fast and effortless the import process is."
@adatfalo
"I have never experienced such a quick and helpful support experience with any plugin, and by the way, the knowledge of the support colleagues is professional!"
@jessedw44
"Even if you just use this plugin once, it will save you time. If you work on several sites its invaluable. Constantly developed, and continuously supported. Great job."
90-Day Guarantee
Not 100% happy? Let us know and we’ll promptly send you a refund.
Free Updates For Life
Pay once for unlimited installs, even client sites. No renewal fees.
Fast, World Class Support
Over 9 years experience with WordPress imports and exports.
Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
Read More

The Structure of an Import Add-On

WP All Import Add-Ons are WordPress plugins that make use of WP All Import's Rapid Add-On API. A few simple lines of code is all it takes to add UI elements to WP All Import and then determine how that data gets imported.

There are four main parts to an add-on. First, you need to register your code as a plugin to WordPress and then as an add-on to WP All Import. Next, you add UI elements for your user to drag and drop data into. Then you tell WP All Import how to import this new data. Finally, you under which circumstances the add-on should run.

Now we'll go through each part of a simple add-on for WP All Import.

1. Create a new WordPress plugin and include the rapid-addon.php file.

To get started, you need to tell WordPress that this is a plugin and then set the groundwork for our import add-on. Start with the WordPress plugin header and then instantiate a class for your add-on.

/*
Plugin Name: My First Add-On
Description: A super awesome add-on for WP All Import!
Version: 1.0
Author: WP All Import
*/
include "rapid-addon.php";

final class my_first_add_on {

    protected static $instance;

    protected $add_on;

    static public function get_instance() {
        if ( self::$instance == NULL ) {
            self::$instance = new self();
        }
        return self::$instance;
    }

2. Initialize the add-on.

Next, create a new instance of the RapidAddon class in the add-on's constructor. Pass the add-on’s name and slug to the RapidAddon's class constructor. The slug should be unique to the add-on and different than the add-on's class name.

protected function __construct() {
        
    // Define the add-on
    $this->add_on = new RapidAddon( 'My First Add-On', 'my_first_addon' );

3. Add UI fields to the import template.

When setting up an import the user will drag and drop their data into WP All Import. The code below will add two text fields to the add-on – one for Property Location, and one for Property Price.

$this->add_on->add_field('property_location', 'Property Location', 'text'); 
$this->add_on->add_field('property_address', 'Property Address', 'text');

After all of the UI fields are set up, define the import method for your add-on with the snippet below. Each time a post is imported or updated, WP All Import will call this method and pass the post ID and the imported data. You'll also need to initialize the add-on with init.

$this->add_on->set_import_function([ $this, 'import' ]);
add_action( 'init', [ $this, 'init' ] );

4. Tell WP All Import how to import data to your theme or plugin.

Here we will get the values of the two fields we created earlier and import them as custom fields.

public function import( $post_id, $data, $import_options, $article ) { 

    $fields = array( 
        'property_location', 
        'property_address' 
    ); 

    foreach ( $fields as $field ) { 
        // Make sure the user has allowed this field to be updated.
        if ( empty( $article['ID'] ) || $this->add_on->can_update_meta( $field, $import_options ) ) { 

            // Update the custom field with the imported data.
            update_post_meta( $post_id, $field, $data[ $field ] ); 
        } 
    } 
}

5. Specify when your add-on runs.

Earlier we initialized our add-on with init. By default, add-ons will always run. You probably want to check to make sure a theme or plugin is active, or limit your add-on to specific custom post types.

public function init() {

    $this->add_on->run( array( "themes" => array("Twenty Fourteen", "Twenty Fifteen") ) );

}

The above code will only allow the add-on to run if the Twenty Fourteen or Twenty Fifteen theme is active.

6. Close out the add-on.

Finally, we need to call the get_instance() method at the end of the file, outside of the class definition:

my_first_add_on::get_instance();

7. That’s all, you are done coding!

To see the add-on in action, install and activate this plugin, and do an import with WP All Import.

The add-on will appear in Step 3 of WP All Import as a box titled My First Add-On:

My First Add-On

Related

Text Fields

Radio Fields

Image Fields

Nested Fields

Lifetime support. Lifetime updates. Pay once.

Packages
Standalone
Import
Pro Package
$249
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import + Export Pro Package
$299
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
WooCommerce Import Package
$149
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import Standalone
$99
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Import + Export Standalone
$169
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
Export Standalone
$99
one-time
  • Import Pro
Import Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
  • Types
  • Export Pro
Export Add-Ons
  • WooCo
  • ACF
  • Gravity Forms
  • Users
Add to Cart
90 Day Money Back Guarantee
cross