Lifetime licenses are only available for a short time!

Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing lifetime licenses will be unaffected so get in while you can!
  • 90-Day Money-Back Guarantee
  • Fast World Class Support
  • Unlimited Sites
  • Free Lifetime Updates
  • Easy to Use
  • Developer Friendly
Risk free! Cancel at any time with our 90-day guarantee
Get a lifetime license now for only 
$99
"All Import/Export is an awesome suite of tools. It gets me out of some tough challenges."
Eric Karkovack, Freelance Writer
"WP All Import - Versatile, and I have saved so much time with it over the years."
Matt Andrews, Full Stack Web Developer
"@WPAllImport just let me import 3000 products from some arbitrary Excel to WooCommerce w/ a few clicks, including images and categories."
Joris Witteman, Developer / Designer

Wait, Don’t Miss Your Chance for a Lifetime License!

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

World Class Support

Over 9 years experience with WordPress imports and exports.

Your Last Chance for a Lifetime License!

We are soon moving to yearly licenses only. Once lifetime licenses are gone, they're gone forever.
@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.

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

Mapping Values From Your File with IF Statements

As WP All Import allows you to use PHP functions on your data, you can create your own custom PHP functions that can be passed values from your data file, and return a certain result based on if/else conditions you set in your function.

Example A – If an element is empty

In this example, we’re checking to see if the element passed is empty or not, and returning a simple text string.

 function is_element_empty($element) {
	if(empty($element)) {
		return "This element is empty.";
	} else {
		return "This element is not empty!";
	}
}

Example B – If an element contains a value

In this example, we’re passing two parameters: the element from the data file that we want to check, and the value we want to search this element for.

 function my_contains_function($element, $value_to_search_for) {
	if (stripos($element, $value_to_search_for) !== false) {
		return $element;
	} else {
		return;
	}
}

If the element passed to this function contains the value to search for, then the element will be returned. Otherwise, an empty result will be returned.

Example C – If one element contains a greater value than another element

In this example, we’re passing two parameters again, this time in the context of comparing two elements that contain prices.

 function choose_price_to_return($price1, $price2) {
	if ($price1 > $price2) {
		return $price1;
	} else {
		return $price2;
	}
}

If the first element passed has a greater value than the second element, the first element will be returned. Otherwise, the second element will be returned.

Further reading:

if statements: http://php.net/manual/en/control-structures.if.php
else statements: http://php.net/manual/en/control-structures.else.php
elseif statements: http://php.net/manual/en/control-structures.elseif.php

Note: If you’re needing some inspiration for writing your own custom IF/ELSE functions, a good resource to check out is stackoverflow.com, as there are lots of code discussions there.


Related

Inline PHP

FOREACH Loops

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