Fix Demo Content Import Timeouts in Envato WordPress Themes

by Fahim

You hit “Import Demo Data” on a freshly bought ThemeForest theme, watch the progress spinner creep to 42%, and get hit with a 504 Gateway Timeout or a dead AJAX spinner. I’ve hit this exact wall more times than I care to admit. Here is how to adjust your server execution limits, bump your web server proxy buffers, and use terminal fallbacks to push stubborn demo imports across the finish line.

Fix Demo Content Import Timeouts in Envato WordPress Themes
Fix Demo Content Import Timeouts in Envato WordPress Themes

Why Envato One-Click Importers Keep Failing

Most commercial themes on Envato bundle plugins like One Click Demo

Import (OCDI), Merlin WP, or proprietary setup wizards. Under the hood, these scripts try to pull off four massive operations inside a fragile HTTP request chain: fetch remote media over cURL, parse multi-megabyte XML export files, write hundreds of taxonomy terms and posts to MySQL, and compile theme option trees.

Shared hosting and stock cloud VPS setups are configured for quick, lightweight web hits. When a PHP worker gets tied up for more than 30 or 60 seconds, the server simply terminates it. Here is what usually goes wrong:

  • PHP max_execution_time: The script blows past the execution cap (often 30s) while resizing massive demo placeholder images.
  • PHP memory_limit: Parsing giant XML files with SimpleXML or XMLReader burns through default 128MB or 256MB memory allocations.
  • Proxy timeouts: Nginx or Apache reverse proxies drop the upstream connection after 60 seconds of waiting, throwing a 504 Gateway Timeout even if PHP-FPM is still chewing on data in the background.
  • MySQL packet limits: Complex theme option blobs and serialized Elementor layouts exceed MySQL’s default max_allowed_packet size.

Before tweaking your configs, rule out baseline file upload issues by checking my guide on how to increase WordPress upload file size.

Step 1: Check the Logs First

Don’t blindly guess which limit you tripped. Turn on WordPress debugging so the fatal error writes to a log file instead of failing silently inside your browser’s DevTools console.

Open your root wp-config.php file and drop in these debug constants.

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Trigger the demo import again until it chokes. Then tail the debug log over SSH.

tail -n 50 wp-content/debug.log

If you see Fatal error: Maximum execution time of 30 seconds exceeded or Allowed memory size of 268435456 bytes exhausted, PHP killed the process. If the log cuts off abruptly with zero fatal errors logged, your web server gateway (Nginx, OpenLiteSpeed, or Cloudflare) dropped the connection upstream. For more details on WordPress error logs, see the official WordPress Debugging documentation.

Step 2: Bump PHP Limits via .htaccess or php.ini

Give PHP enough breathing room to pull down dozens of demo images and build menu hierarchies. These values work well for heavy themes without putting server stability at risk.

If your host runs Apache or LiteSpeed with standard directives, add this to the top of your site’s root .htaccess file, right before the # BEGIN WordPress line.

php_value max_execution_time 300
php_value max_input_time 300
php_value memory_limit 512M
php_value post_max_size 128M
php_value upload_max_filesize 128M

If you’re on Nginx with PHP-FPM, .htaccess is ignored. Instead, open your active php.ini (often at /etc/php/8.2/fpm/php.ini or inside your hosting panel) and change these directives.

max_execution_time = 300
max_input_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M

Whenever you edit php.ini on your own server, make sure to reload the PHP-FPM service.

sudo systemctl restart php8.2-fpm

Keep in mind that some managed hosts lock down these limits with strict caps. If your theme zip failed to upload earlier due to similar package boundaries, check out my walk-through on how to fix ‘The link you followed has expired’ in WordPress.

Step 3: Fix Nginx and FastCGI Gateway Timeouts

If you’re running Nginx with PHP-FPM, setting PHP’s max_execution_time to 300 seconds does nothing if Nginx gives up after 60 seconds. That mismatch is the number one cause of the 504 Gateway Time-out error.

Open your site’s Nginx configuration (usually in /etc/nginx/sites-available/yourdomain.com or /etc/nginx/conf.d/default.conf).

sudo nano /etc/nginx/sites-available/yourdomain.com

Locate the location ~ .php$ block and increase the FastCGI timeout values.

location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_connect_timeout 300s; fastcgi_send_timeout 300s; fastcgi_read_timeout 300s; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k;
}

If Nginx runs as a reverse proxy sitting in front of Apache, update the proxy timeout lines inside the server { ... } block instead.

proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;

Always test your syntax before reloading Nginx.

sudo nginx -t && sudo systemctl restart nginx

Step 4: Increase the MySQL Packet Size

Themes bundled with heavy builders like Elementor, WPBakery, or Slider Revolution store massive homepage layouts inside serialized post meta. When the import script attempts to insert these giant query strings, MySQL will drop the connection if the payload exceeds max_allowed_packet.

Check your current packet limit from the MySQL CLI.

mysql -u root -p -e "SHOW VARIABLES LIKE 'max_allowed_packet';"

If the output shows 16777216 (16MB) or lower, open your MySQL config (/etc/mysql/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf) and bump it to 64MB or 128MB.

[mysqld]
max_allowed_packet = 128M
wait_timeout = 300
interactive_timeout = 300

Restart MySQL to apply the new setting.

sudo systemctl restart mysql

Step 5: Clean Up Half-Imported Junk Before Trying Again

A failed

import leaves a mess. You'll end up with duplicated categories, half-configured widgets, and broken menu items. Retrying the import without cleaning up first creates duplicate permalinks (like about-us-2) and bloated options tables.

If this is a brand-new site with no personal content yet, wipe the database clean using WP-CLI.

wp db reset --yes
wp core install --url="https://example.com" --title="Staging Site" --admin_user="devadmin" --admin_password="StrongPassword123!" --admin_email="admin@example.com"

If you already have pages you can’t afford to delete, install the free WP Reset plugin to flush theme mods, posts, and media while keeping your user accounts intact.

If your database is already cluttered with leftover junk from past runs, see our guide on how to clean bloated autoload options with WP-CLI.

Step 6: Import Demo Content via WP-CLI (Skip the Browser)

Browser importers are fragile. If your Wi-Fi flickers or Chrome puts your tab to sleep, the AJAX worker dies. Running the import directly on your server via WP-CLI skips web server timeouts altogether.

First, find the raw demo files. Unzip the full package you downloaded from ThemeForest and search for folders named demo-data, inc/demo, or assets/importer. You’ll typically find:

  • content.xml (or demo-content.xml)
  • widgets.wie or widgets.json
  • customizer.dat or theme-options.json

Install the official WordPress import package through WP-CLI.

wp package install wp-cli/wordpress-importer:dev-master

Run the XML import straight from your shell. Add --authors=create so WP-CLI maps the demo authors to your user account automatically.

wp import /path/to/theme/demo-data/content.xml --authors=create

Under CLI mode, PHP sets max_execution_time to 0 (infinite) by default, so it can churn through 500 images without getting killed. Check the official WP-CLI

Step 7: Fix Remote Image Download Timeouts

Envato theme authors usually host their demo images on external S3 buckets or CDN endpoints. If their storage server throttles your requests or takes too long to respond, PHP’s cURL request hangs waiting for bytes.

You can temporarily bump the HTTP request timeout in WordPress using the http_request_args filter. Drop this snippet into your child theme’s functions.php file before starting the import.

add_filter('http_request_args', function ($args) { $args['timeout'] = 120; return $args;
}, 99);

If the author’s media server has an expired or misconfigured SSL certificate, cURL will throw an error on every single attachment. You can bypass SSL verification strictly during the import phase with this filter.

add_filter('https_ssl_verify', '__return_false');

Be sure to delete both snippets from functions.php the moment your demo finishes importing. Leaving SSL verification disabled on a live site is a major security risk.

If your child theme requires additional structure adjustments after adding these hooks, see our guide on how to override unpluggable parent theme functions in WordPress.

Frequently Asked Questions

Can I skip importing demo media files?

Yes. Many one-click importer plugins include a checkbox to “Exclude images” or “Import placeholder images”. Selecting this creates your layouts with blank colored boxes instead of downloading 500MB of stock photos, dropping your import time from fifteen minutes down to thirty seconds.

Why does the import stick at 99%?

A hang at 99% almost always means the core content imported fine, but the final task—generating theme CSS, compiling Elementor caches, or importing Slider Revolution sliders—ran out of memory. Refresh your wp-admin area and open your Pages menu. In most cases, the content is actually there.

Will Cloudflare cause demo import timeouts?

Yes. Free and Pro Cloudflare plans enforce a hard 100-second timeout on dynamic requests. If a single AJAX step runs 101 seconds, Cloudflare returns an HTTP 524 A timeout occurred error. Turn on “Development Mode” or temporarily set your DNS record to grey-cloud (DNS only) while running the import.

Where do I find the PHP CLI configuration file?

Run php -i | grep "Loaded Configuration File" in your terminal. On Ubuntu with PHP 8.2, it usually lives at /etc/php/8.2/cli/php.ini. This config is separate from the FPM or Apache php.ini file.

Next Steps

Once your demo layouts and menus are working, clean up the background bloat. Commercial themes tend to load dozens of scripts you won’t actually use. Check out our guide on how to dequeue unused scripts and styles in Envato themes to keep page loads fast.

Official resources

all_in_one_marketing_tool