504 Error When Importing Demo Data
A 504 (Gateway Timeout) error usually appears when the demo import process takes too long, causing the connection between the server and memory to time out.
1. Common Causes of 504 During Import
Common causes include:
- Limited server resources (small CPU/RAM).
- PHP execution time too short (
max_execution_time). - PHP memory limit too small (
memory_limit). - Upload or post size limits too low.
- The demo import loads many images and content, exceeding the server’s time or memory limits.
2. Increase Memory Limit and Cron Lock in wp-config.php
The first recommended step is to increase WordPress’s memory limit and adjust the cron lock timeout.
- Open the
wp-config.phpfile in your WordPress installation root. - Add the following lines on a new line (before the comment
/* That's all, stop editing! */or similar):
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_CRON_LOCK_TIMEOUT', 360 );Quick explanation:
WP_MEMORY_LIMITincreases the memory available to WordPress to 256 MB.WP_CRON_LOCK_TIMEOUTsets how long a cron lock remains (in seconds) before timing out.
Save the file, then retry the demo import process.
3. Retry Import After Changes
Sometimes a 504 error occurs because the first import is heavy or the connection briefly dropped.
- Retry the demo import after adding the configuration in
wp-config.php. - Ensure your internet connection is stable during the import.
If errors persist, proceed with manual import.
4. Import Demo Data Manually
If automatic import still fails (especially due to timeouts and memory limits), you can import manually.
- Extract the packed download of the Idtheme you’re using.
- Go to the
demo-datafolder inside the extracted package. - Inside, you typically find:
- Files with the
.xmlextension. - Files with the
.datextension. - Files with the
.jsonextension (for widgets, to be renamed later).
- Files with the
a. Import .xml (Content)
- Go to Tools → Import in the WordPress dashboard.
- Choose WordPress (if not installed, install the WordPress Importer).
- Upload the
.xmlfile fromdemo-data. - Follow the import wizard to completion.
Tip: if the server often runs out of memory, during content import you can try not checking Download and import file attachments to avoid importing all images.
b. Import .dat (Customizer)
- Install and activate the Customizer Export/Import plugin.
- Go to Appearance → Customize.
- Find the Export/Import menu (or similar).
- Import the
.datfile fromdemo-data.
c. Import Widgets (.json → .wie)
- In the
demo-datafolder, there is usually a.jsonfile containing widget configuration. - Rename the file to the
.wieextension, for example:- From:
widgets.json - To:
widgets.wie
- From:
- Install and activate the Widget Importer & Exporter plugin.
- Open the plugin menu in the dashboard.
- Import the renamed
.wiefile.
5. Important Notes During Import
- If importing the
.xmlfile fails, common causes are:- Too many images being imported at once.
- The server runs out of memory when importing attachments.
- Solutions:
- Try importing without attachments.
- Or import content first; upload images manually later if needed.
6. If Problems Persist
If all the steps above have been done but the 504 error still occurs:
- Contact hosting support and explain the error happens during WordPress demo data import.
- Include:
- Time of occurrence.
- Your hosting package type.
- Estimated size of the demo being imported.
- If you’re using an Idtheme product:
- Submit a ticket or contact the Idtheme team.
- Provide temporary login information (if requested) so the team can check directly.
