Install Envato Theme and Demo Content with WP-CLI

by Fahim

Upload a 250MB ThemeForest zip through wp-admin and you already know what happens: either a 413 Request Entity Too Large error or an Nginx gateway timeout while importing dummy widgets. After losing an entire afternoon watching an Elementor demo import choke at 82% across three separate browser tabs, I stopped using the dashboard entirely for this.

WP-CLI bypasses PHP-FPM execution limits, ignores Nginx client payload caps, and writes straight to MySQL without a browser dropping your AJAX polling connection halfway through.

Terminal screen showing WP-CLI theme install and demo content import commands
Terminal screen showing WP-CLI theme install and demo content import commands

Why Browser-Based Theme and Demo Uploads Choke

Most commercial themes on Envato pack everything into one master archive: licensing docs, PSD/Figma files, child themes, and nested zips for bundled plugins like Slider Revolution or WPBakery. If you upload that entire archive via Appearance > Themes > Add New, WordPress unpacks the root, can’t find a stylesheet, and crashes with an error.

Even if you already know to fix the missing style.css error by extracting the sub-folder first, the demo import itself is a minefield. Browser importers fire dozens of chained AJAX requests back to admin-ajax.php to fetch remote images, run resize calculations, and register terms.

If your web server enforces a 30 or 60-second max_execution_time, PHP kills the worker process while it’s crunching attachments. Running this through the CLI changes the game: CLI PHP doesn’t enforce execution timeouts by default, and you can give it as much RAM as your server can spare.

Unpack the Envato Zip Without Upload Traps

First, get the downloaded Envato archive onto your server or unpack it locally. You need to strip away the wrapper archive and find the actual theme folder before passing anything to WP-CLI.

SSH into your box, head to your site root, and set up a scratch directory in /tmp so you don’t dump junk files into your webroot:

Extract the archive and check what’s inside:

mkdir -p /tmp/envato-scratch
cd /tmp/envato-scratch
unzip ~/themeforest-upload-pack.zip
ls -la

Almost every Envato package unpacks like this:

drwxr-xr-x 2 user user 4096 Apr 12 10:14 Documentation
drwxr-xr-x 2 user user 4096 Apr 12 10:14 Licensing
-rw-r--r-- 1 user user 24501230 Apr 12 10:15 themename.zip
-rw-r--r-- 1 user user 14201 Apr 12 10:15 themename-child.zip
drwxr-xr-x 2 user user 4096 Apr 12 10:15 Plugins

The only files you need right now are themename.zip, themename-child.zip, and any zips tucked inside the Plugins folder. Leave everything else behind.

Install Parent and Child Themes via WP-CLI

Change into your WordPress root directory (where wp-config.php lives). We’ll use the native WP-CLI theme install command to deploy both themes directly from our temp folder.

Run these commands, pointing to the absolute paths of the extracted zips:

cd /var/www/my-site/public_html
wp theme install /tmp/envato-scratch/themename.zip
wp theme install /tmp/envato-scratch/themename-child.zip --activate

Passing --activate on the child theme handles the hierarchy immediately. WordPress activates the child theme while keeping the parent available as the engine.

Confirm both themes are registered and the hierarchy looks right:

wp theme list --fields=name,status,update,version

You should see themename-child as active and themename as parent. If the parent throws an error, pop open the child theme’s style.css and make sure the Template: header matches the exact folder name of the parent theme.

Activate Required and Bundled Plugins in One Go

Most Envato themes look completely broken out of the box until their companion plugins are up and running. That usually means a mix of repo plugins (Contact Form 7, Elementor, WooCommerce) and premium zips included with the theme (Slider Revolution or a custom core plugin).

First, grab and activate the free repo plugins in a single line:

wp plugin install contact-form-7 elementor woocommerce one-click-demo-import --activate

Next, install any proprietary plugin zips sitting in that unpacked scratch directory:

wp plugin install /tmp/envato-scratch/Plugins/theme-core.zip --activate
wp plugin install /tmp/envato-scratch/Plugins/revslider.zip --activate

If your theme relies on TGM Plugin Activation (TGMPA)—and most do—you can query which plugins the author marked as required directly from the CLI:

wp eval 'if (class_exists("TGM_Plugin_Activation")) { print_r(array_keys(TGM_Plugin_Activation::$instance->plugins)); }'

This prints out every required and recommended plugin slug registered by the theme. Compare that against wp plugin list to make sure you didn’t miss an essential dependency.

Tune PHP CLI Limits Before Pulling Demo Content

Don’t assume your CLI runs with the same limits you set for Nginx or Apache in php.ini. It doesn’t. The CLI binary loads its own config (often /etc/php/8.2/cli/php.ini instead of fpm/php.ini).

Check your active CLI memory limit first:

php -r "echo ini_get('memory_limit');"

If that shows 128M or 256M, an XML import packed with hundreds of media attachments will crash PHP with an out-of-memory error. You can override this per-command without touching system files:

php -d memory_limit=1024M $(which wp) --info

This temporarily grants 1GB of memory to the PHP process running WP-CLI. We’ll use this pattern for the actual demo import.

Execute the Demo Content Import via WP-CLI

Envato themes generally

import demo content in one of two ways: using the One Click Demo Import (OCDI) plugin, or through their own internal AJAX importer. We can run both from the terminal.

Method A: Themes Using One Click Demo Import (OCDI)

If your theme uses OCDI (or you installed it because the theme docs asked for it), the plugin registers its own WP-CLI commands automatically.

First, list the demo presets bundled with the theme:

wp ocdi list

You’ll see an indexed list of variations (usually starting at 0):

+-------+---------------------+
| Index | Import Session Name |
+-------+---------------------+
| 0 | Main Corporate Demo |
| 1 | Agency Dark Demo |
| 2 | Shop Minimal Demo |
+-------+---------------------+

Pick the index you want and run the import with your memory override in place:

php -d memory_limit=1024M $(which wp) ocdi import --id=0

The terminal will stream progress updates as it imports post objects, taxonomies, sidebars, and attachments. No browser drops, no 504 timeouts, and none of the headaches common with browser-based Envato demo imports.

Method B: Manual Import via Standard WP-CLI Tools

If the theme doesn’t hook into OCDI, check the theme directory for folders named inc/demo/ or assets/demo/. You’ll typically find three files there:

  • content.xml (posts, pages, media records)
  • widgets.wie or widgets.json (sidebar placements)
  • customizer.dat (colors, typography, layout options)

You can import these directly using official CLI tools. Grab the core WordPress import plugin first:

wp plugin install wordpress-importer --activate

Run the XML import to create the posts and pull remote images:

php -d memory_limit=1024M $(which wp) import wp-content/themes/themename/demo-data/content.xml --authors=create

If the theme included a widget export (.wie), install the Widget Importer & Exporter plugin and run its command:

wp plugin install widget-importer-exporter --activate
wp widget-importer-exporter import wp-content/themes/themename/demo-data/widgets.wie

Fix Broken Menus, Widgets, and Missing Slugs

Once demo data lands in the database, two things almost always need manual fixing: menus detach from their registered locations, and the homepage defaults back to displaying latest posts instead of the imported landing page.

Check the imported menus:

wp menu list

Then list the menu slots your active theme expects:

wp menu location list

Assign the imported demo menu (e.g., ID 4) to your theme’s header location (e.g., primary-menu):

wp menu location assign 4 primary-menu

Next, find which imported page was meant to be the homepage:

wp post list --post_type=page --post_status=publish --s="Home" --fields=ID,post_title,post_name

Grab its ID (say, 42) and tell WordPress to use it as the static front page:

wp option update show_on_front 'page'
wp option update page_on_front 42

If there’s an imported blog archive page (e.g., ID 45), set that too:

wp option update page_for_posts 45

Clean Up and Regenerate Rewrites

Big XML imports leave behind transient caches and stale permalink rules. Flush rewrite rules so newly registered post types work immediately without you having to visit the Permalinks admin screen:

wp rewrite flush --hard

Clear out any transient options created during the import run:

wp transient delete --all

If you see a sudden spike in database size from sample content and demo configurations, you can clean up bloated wp_options autoload entries with WP-CLI to keep queries fast.

Finally, clean up your temporary folder so you don’t leave theme archives and license files sitting on your disk:

rm -rf /tmp/envato-scratch

Frequently Asked Questions

Can I run this without root SSH access?

Yes. As long as your hosting account gives you regular shell access and has the wp binary installed, you’re fine. You only need write permissions in your own public_html or site directory. If WP-CLI isn’t installed system-wide, drop the wp-cli.phar binary into your home folder and run it via php ~/wp-cli.phar.

What if images fail to download during the CLI import?

Theme authors host demo images on their own staging servers. If their server blocks your host’s IP or the remote links are dead, the XML parser skips the download and creates empty attachment entries. To see exactly which URLs are failing, pass the --debug flag: wp import content.xml --authors=create --debug.

Do I need an Envato Market API token for WP-CLI installs?

Not for manual installs from zip archives. But if you want one-click theme updates down the line, you’ll still want to install the Envato Market plugin and configure your Personal Token in the dashboard.

How do I fix mixed HTTP/HTTPS URLs after the demo import?

Demo packages regularly hardcode the author’s demo domain into page builder elements (like http://demo.author.com/wp-content/uploads/...). Run a search-replace using the native wp search-replace workflow to update those URLs safely without corrupting serialized PHP arrays.

Next Steps

Once your theme and demo layout are loaded, take a look at your database for leftover transients and orphaned autoload options from test plugins. Running through our guide on cleaning up bloated wp_options autoload entries will keep queries lean before you begin production development.

Official resources

all_in_one_marketing_tool