Clicking “Import Demo Data” in wp-admin on a ThemeForest theme is basically gambling. You stare at a spinning circle for two minutes, Nginx drops a 504 Gateway Time-out, and your database gets stuck with twenty half-imported menus, missing taxonomies, and hundreds of broken attachment posts.
Skip the browser. Whenever I set up a client site with a ThemeForest monster theme, I do the whole thing over SSH. Here is how to take that bloated Envato zip, unpack the right files, install parent and child themes, batch-activate the bundled plugins, and pull in demo content directly with WP-CLI.

Why the Browser Fails on ThemeForest Demos
Commercial themes bundle an absurd amount of junk into their demo packages: hundreds of megabytes of dummy WooCommerce inventory, mega-menu structures, Slider Revolution slide decks, and heavy page builder layouts. When you fire that import off from the admin UI, WordPress tries to cram that entire pipeline into a single synchronous HTTP request managed by PHP-FPM.
If your PHP max_execution_time is sitting at 30 or 60 seconds, the worker gets murdered before it finishes fetching the first gallery batch. Jacking the limit up to 300 seconds rarely helps either—Cloudflare or Nginx will cut the connection anyway if no bytes flush back within 60 seconds. We broke down these exact choke points when troubleshooting demo content import timeouts on WordPress.
WP-CLI runs through the CLI binary instead of web server proxies, so HTTP timeouts don’t exist. You get direct access to server RAM, real-time stdout showing every post ID as it writes to the DB, and zero risk of a random browser drop corrupting your tables midway through.
Step 1: Unpack and Verify the Envato Package
If you feed the raw zip you downloaded from ThemeForest (usually named something like themeforest-XXXXX-theme-name-wordpress-theme.zip) straight to WordPress, it blows up instantly.
That raw bundle is packed with documentation, licensing text files, PSD mockups, and plugins. It is not an actual WordPress theme zip. We covered how to avoid that mess in our guide on how to fix the missing style.css stylesheet error.
SSH into your box, stash the archive in a temp directory, and extract it so you can get to the actual installable theme archives:
# Move into a temporary working folder
cd /tmp
mkdir theme-bundle && cd theme-bundle # Unzip the main Envato archive
unzip ~/downloads/themeforest-bundle.zip # List the contents to find the installable zips
ls -laCheck the extracted directory. You are hunting for two specific zips: theme-name.zip (the parent) and theme-name-child.zip (the child). Make sure your theme came with proper child theme scaffolding by checking our checklist for choosing a ThemeForest theme before doing anything else.
Step 2: Install Parent and Child Themes with WP-CLI
Head to your WordPress root (like /var/www/html). Run wp theme install against both zip paths in your temp folder, activating only the child theme:
# Navigate to WordPress web root
cd /var/www/html # Install the parent theme archive
wp theme install /tmp/theme-bundle/theme-name.zip # Install and activate the child theme directly
wp theme install /tmp/theme-bundle/theme-name-child.zip --activateConfirm the child theme is recognized and active:
wp theme list --status=activeYou should see your child theme marked as active, cleanly inheriting templates and stylesheets from the parent theme directory.
Step 3: Install Required and Bundled Plugins
ThemeForest themes rely heavily on bundled plugins to render layouts—usually Elementor, WPBakery, Slider Revolution, and a custom post type plugin. Most use the TGM Plugin Activation (TGMPA) class behind the scenes.
Grab whatever is on the public WordPress repo first. You can knock this out in a single line:
# Install standard repo plugins required by your demo
wp plugin install elementor contact-form-7 woocommerce --activateFor the bundled premium plugins, dig through the extracted files. They usually sit in inc/plugins/, framework/plugins/, or a root plugins/ folder in the Envato archive. Pass those paths straight to WP-CLI:
# Install premium bundled zips locally
wp plugin install wp-content/themes/theme-name/inc/plugins/revslider.zip --activate
wp plugin install wp-content/themes/theme-name/inc/plugins/theme-core.zip --activateDon’t skip activating these before running the demo import. If a theme’s demo relies on a custom post type registered by theme-core.zip, importing content beforehand causes WordPress to drop that data into standard post tables or discard custom meta entirely.
Step 4: Import the XML Content File
Make sure the official WordPress importer package is installed for WP-CLI:
# Check if the wordpress-importer tool is available
wp plugin install wordpress-importer --activateFind the demo XML/WXR file. If the theme supports manual imports, you’ll usually spot it in demo/ or inc/importer/ named something like demo-content.xml or content.xml.
Run the import, mapping existing post authors to your current admin user and telling WP-CLI to download remote attachments:
# Run the import with attachment downloading enabled
wp import wp-content/themes/theme-name/demo/content.xml --authors=skip --user=adminThis is where CLI crushes the browser UI. Instead of an unhelpful progress bar that freezes at 30%, you get a real-time terminal stream showing every page, menu item, and thumbnail processing:
Importing post 'Home - Modern Agency' (ID: 104)... Done
Importing post 'About Us' (ID: 108)... Done
Importing attachment 'hero-banner.jpg' (ID: 112)... Done
Progress: 42/380 posts imported.If you ever need to fall back to the browser or walk a client through dashboard options, check our guide on how to install Envato themes and demo content without errors.
Step 5: Trigger One-Click Demo Importers via wp eval
A lot of modern themes do not ship raw XML files anymore. They bundle wizard importers like Merlin WP or One Click Demo
Import (OCDI). When that happens, raw wp import will miss theme options, customizer values, and widget areas.You can still bypass the browser by calling the theme’s internal import hooks via wp eval. Most developers wire OCDI routines to action hooks. Look inside the theme’s functions files for pt-ocdi/after_import or custom setup classes.
If the theme uses stock OCDI, you can trigger demo routines programmatically:
# Call the internal import execution routine via WP-CLI
wp eval '
if ( class_exists( "OCDIOneClickDemoImport" ) ) { $importer = OCDIOneClickDemoImport::get_instance(); // Run the demo index 0 (usually the default main demo) $importer->import_demo_data( 0 ); echo "Demo import routine executed.
";
} else { echo "OCDI class not found.
";
}
'If the author wrote a custom AJAX handler, inspect your browser network tab on a staging run to grab the action name (e.g., theme_action_import_demo). Then fire it headlessly:
# Trigger a custom theme AJAX handler directly via terminal
wp eval 'do_action( "wp_ajax_theme_demo_importer", array( "selected_demo" => "agency" ) );'Step 6: Import Customizer Options and Widgets
XML files handle posts, terms, and media, but they rarely include customizer settings, header styles, and global colors. Themes package those as JSON, DAT, or WIE files.
If you have a customizer.dat or theme-options.json file, push those values directly into the database. For clean JSON files, decode and write directly to the theme mods table:
# Import theme mods directly from the JSON demo options
wp eval '
$options_raw = file_get_contents( "wp-content/themes/theme-name/demo/theme-options.json" );
$options = json_decode( $options_raw, true );
if ( is_array( $options ) ) { foreach ( $options as $key => $value ) { set_theme_mod( $key, $value ); } echo "Theme options updated successfully.
";
}
'For sidebars and widgets (usually packaged in widgets.wie), you can
# Install the widget importer utility
wp plugin install widget-importer-exporter --activate # Import the demo widget placements
wp widget-importer import wp-content/themes/theme-name/demo/widgets.wieStep 7: Regenerate Thumbnails and Fix Local URLs
When remote image downloads drop connections midway through, WordPress creates the media library record but skips generating crop dimensions.
Run thumbnail regeneration from the terminal to cut all custom sizes required by the theme:
# Regenerate missing image dimensions without interactive prompts
wp media regenerate --yesNext, demo data is littered with hardcoded URLs pointing back to the author’s staging site (e.g., https://demo.themeforest-author.com/agency). Run wp search-replace to update them to your domain. This safely handles serialized PHP data strings without corrupting settings arrays:
# Safely search and replace author staging links
wp search-replace 'https://demo.themeforest-author.com/agency' 'https://yoursite.com' --all-tables --precise --dry-runCheck the dry run output first. If the replacement counts look sensible and nothing crashes, drop --dry-run to write the changes.
Gotcha: Memory Limits in CLI Contexts
I hit this bug all the time on fresh VPS builds: your site might have memory_limit = 512M set in /etc/php/8.2/fpm/php.ini, but the CLI binary reads an entirely separate file at /etc/php/8.2/cli/php.ini. That CLI config often defaults to 128M.
If you run into Fatal error: Allowed memory size of X bytes exhausted during wp import, pass the memory override flag straight into the PHP binary running WP-CLI:
# Run WP-CLI with an explicit 1GB memory allocation
php -d memory_limit=1024M $(which wp) import demo/content.xml --authors=skipTo see which config file your CLI binary is actually reading, run:
php --ini | grep "Loaded Configuration File"Configuring Navigation Menus and Front Page
The last step to making the site look like the ThemeForest demo preview is assigning the imported menu to the theme’s header slot and setting the static homepage.
Find the imported menu IDs and theme location slugs, then assign them:
# List all imported navigation menus
wp menu list # List theme menu locations
wp menu location list # Assign the primary imported menu to the theme's header location
wp menu location assign "Main Menu" primary-navigationFind the imported homepage title or slug and set it as the static front page:
# Find the ID of your imported Home page
wp post list --post_type=page --post_title="Home" --field=ID # Configure front page displays
wp option update show_on_front 'page'
wp option update page_on_front 104Flush your object cache and rewrite rules so everything resolves properly:
# Flush rewrite rules and cache
wp rewrite flush
wp cache flushFrequently Asked Questions
What if the theme author does not provide a loose XML file?
If the theme hides demo content behind a proprietary importer plugin, unzip that plugin directly. Authors almost always bundle their XML, WXR, and JSON data inside subfolders like assets/demos/ or importer/data/.
Can I run WP-CLI demo imports on shared hosting?
Yes, as long as you have SSH access. If the wp command is not installed globally by your host, grab wp-cli.phar directly into your home folder and invoke it with php ~/wp-cli.phar.
Why are some demo images missing after the terminal import?
Theme authors usually do not have license rights to redistribute commercial stock photos shown in their live previews. They will swap the images in demo XML files for blank gray placeholder boxes or link to external demo servers that block hotlinking.
Will running wp import duplicate my existing content?
Yes. If you run wp import twice against the same XML file, you will end up with duplicate posts, duplicate categories, and duplicate navigation links. If an import goes sideways, wipe your test environment with wp site empty --yes before trying again.

