Lifetime Licenses Are Ending Soon, Get Yours Before They're Gone
 - 
Read More
Lifetime Licenses Are Ending Soon, Get Yours Before They're Gone
 - 
Read More
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

How to Import Gutenberg Blocks

To import Gutenberg Blocks into WordPress using WP All Import, manually define the blocks in the import template. To do this, create a post using the blocks you'd like to import, then copy and paste them into the WP All Import content box on the Edit Import page. Replace the content with the data you'd like to import, then run your import.

Step 1: Obtain Gutenberg Data Example

Manually create a post that contains the Gutenberg blocks you want to import.

Import Gutenberg Blocks Example Blocks

Step 2: Copy and Adjust HTML Block Data

View the HTML of the manually created post:

Import Gutenberg Blocks Get Code

You can also select the blocks directly in Gutenberg, copy them, and then paste the blocks directly into WP All Import.

Step 3: Use The Adjusted Data While Importing

Paste the data into the Content area of your import, then replace static text with the appropriate import elements:

Import Gutenberg Blocks Add Import Elements

Make sure to use the Text tab and not the Visual tab to input these blocks.

Here's an example that imports a {content[1]} element into a paragraph block:

<!-- wp:paragraph -->
<p>{content[1]}</p>
<!-- /wp:paragraph -->

Braces or opening brackets that are unrelated to the XPath for the WP All Import template will need to be escaped: "\{", "\}" and "\[". To elaborate on that, here are a couple of example Gutenberg blocks that must be escaped:


<!-- wp:acf/dropdown \{"name":"acf/dropdown","data":\{"title":"Applicable Ashes of War","_title":"field_64c420013d8c7"\},"mode":"preview"\} -->

<!-- wp:heading \{"level":4\} -->
<h4 class="wp-block-heading">{headline[1]}</h4>
<!-- /wp:heading -->

Depending on the blocks you're planning on using, you may need to write custom code that uses our API to import them (https://www.wpallimport.com/documentation/action-reference/).

Example: Parse Blocks with PHP

Let's say that you have multiple paragraphs in a single text block, and you want to parse them to include the required <!-- wp:paragraph --> tags, but you don't want to modify this text block manually. Instead, you'd like to use PHP code. Here's how to do it:

Example Text:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Example Code:

function my_custom_block($string){
	$new = preg_split('/\n\s*\n/', $string);
	$output = '';
	foreach ($new as $pg) {
		$output .= "<!-- wp:paragraph -->\n";
		$output .= "<p>{$pg}</p>\n";
		$output .= "<!-- /wp:paragraph -->\n";
	}
	return $output;
}

Usage Example:

The function is used like this:

[my_custom_block({content[1]})]

See:

Import Gutenberg Blocks Example Use PHP

Result:

Import Gutenberg Blocks Example Imported Blocks with PHP

Related Docs

Learn more about using PHP custom code in your import process.

Learn how to use WP All Import to import data into WordPress.

API documentation for both WP All Import and WP All Export.

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

Lifetime support. Lifetime updates. Pay once.

Packages
Standalone
Import
Pro Package
$299
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee
Import + Export Pro Package
$399
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee
WooCommerce Import Package
$199
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee
Import Standalone
$99
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee
Import + Export Standalone
$169
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee
Export Standalone
$99
one-time
  • 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
Add to Cart
90 Day Money Back Guarantee

Lifetime support. Lifetime updates. Pay once.

Import
Pro Package
$199
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
Export
Pro Package
$199
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