So you’re trying to move posts, pages, or products into WordPress and the import tool just spits out an error. Annoying, right? The classic «error when importing data in WordPress» hits almost everyone who’s ever migrated a site. Good news: in most cases you can fix it yourself in under 15 minutes. Bad news: if you ignore the real cause, it’ll come back the moment you try again.
Let’s be clear from the start: WordPress itself rarely breaks. The problem almost always sits in the source file, a plugin conflict, or a hosting limit that nobody warned you about.
What Actually Triggers a WordPress Data Import Error
The WordPress importer (whether it’s the native WXR importer, WP All Import, or a CSV loader) is a picky beast. It expects a specific structure. If the XML or CSV file has malformed characters, a wrong delimiter, or an encoding that isn’t UTF-8, the import stops dead.
Other common culprits: a plugin hijacking the AJAX request, a theme adding output before headers, a max_execution_time that cuts the process at 30 seconds, or a memory_limit stuck at 128M while you’re pushing 5,000 products.
And yes, sometimes it’s just your hosting. Cheap shared plans love to throttle long-running PHP processes, which is exactly what a data import is.
Step 1: Sanity-Check the Source File Before Touching WordPress
Open your CSV or XML in a plain text editor, not Excel. Excel loves to convert UTF-8 to ANSI and destroy accents, ñ, and emojis. That alone causes the infamous «Sorry, there has been an error» message.
Check these three things:
- The file is UTF-8 encoded (no BOM, ideally).
- CSV delimiters match what your importer expects (comma vs semicolon — Spanish Excel exports use semicolons).
- No empty first row, no merged cells, no formulas.
If you’re importing from another WordPress site, use the official WXR export. Don’t try to hand-craft XML. That way madness lies.
Step 2: Kill the Plugin and Theme Conflicts
This is the fastest diagnostic you can run. Deactivate every plugin except the importer, and switch to Twenty Twenty-Five. Then retry the import.
If it works, reactivate plugins one by one until it breaks. Congratulations, you just found the culprit. Nine times out of ten it’s a security plugin blocking the admin-ajax.php call, or a caching plugin serving a stale nonce.
Theme conflicts are rarer but real. A theme that dumps JavaScript into the admin footer can break the importer’s progress bar and kill the request mid-way.
Step 3: Raise Your Server Limits (The Real Fix)
Big imports need breathing room. Default PHP limits are designed for small sites, not for moving 10,000 WooCommerce orders.
Edit your wp-config.php and add this near the top, before «That’s all, stop editing»:
set_time_limit(300);
define(‘WP_MEMORY_LIMIT’, ‘512M’);
define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);
Then check your php.ini (or ask your host) for:
- max_execution_time = 300
- memory_limit = 512M
- upload_max_filesize = 64M
- post_max_size = 64M
If your host won’t let you touch these, switch hosts. Seriously. A WordPress import error caused by a 30-second timeout on a shared server isn’t something you «work around» — it’s a hosting problem.
Step 4: Split the Import Into Chunks
Even with 512M of RAM, importing 20,000 posts in one go is asking for trouble. Split your CSV into batches of 500–1,000 rows and import them sequentially.
WP All Import handles this natively with its «Import chunks» setting. The native WordPress importer doesn’t, so you’ll need to split the WXR file manually or use a plugin like WP Import Export.
This single trick eliminates about 70% of timeout-related errors when importing data in WordPress.
When Nothing Works: Debugging Mode
Turn on WP_DEBUG in wp-config.php:
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
Retry the import. Then open /wp-content/debug.log. The actual error message will be there — not the generic «There has been a critical error» that WordPress shows on screen.
Look for things like «Allowed memory size exhausted,» «Maximum execution time exceeded,» or a specific plugin file throwing a fatal error. That log is your map.
CSV-Specific Nightmares Worth Knowing
If you’re importing products with WP All Import, watch out for:
- Serialized data inside CSV cells (breaks on import).
- Duplicate SKUs causing unique constraint failures.
- Dates in dd/mm/yyyy format when the importer expects yyyy-mm-dd.
- Categories separated by «|» instead of «,».
Each of these produces a different error message, but they all fall under the same umbrella: the error when importing data in WordPress is almost never WordPress’s fault.
Should You Just Hire Someone?
Honestly? If you’ve tried the steps above and you’re still stuck, the ROI of hiring a WordPress dev for two hours beats you losing a full day. A pro will read the debug log, spot the conflict, and fix it in 20 minutes.
But don’t hire before you’ve done at least steps 1–3. Half the «experts» out there just do exactly that and charge you $150 for a 5-minute fix.
One last thing: always back up your database before importing. Always. If the import half-completes and corrupts your posts table, you’ll thank yourself.