[wp-trac] [WordPress Trac] #63503: Exporting in high data instances results in empty file download
WordPress Trac
noreply at wordpress.org
Thu May 29 20:38:04 UTC 2025
#63503: Exporting in high data instances results in empty file download
--------------------------+-----------------------------
Reporter: bor0 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Export | Version: 6.8
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When attempting to export products or documentation on a large WP instance
with a lot of data, an empty .xml file is downloaded. This causes problems
when we need to export updated content from production for use on our dev
environments.
In our investigation, we found out that the query gets stopped because it
runs for too long.
It comes from WP core:
https://github.com/WordPress/WordPress/blob/2879b85136044a56fdd908a56c79c85a0ed7a39e
/wp-admin/includes/export.php#L415. The query is also super long as it
contains 23794 entries in the `$post_ids` array, though:
{{{
$ time vip wp -a woocommerce -e production -y -- db query "SELECT count(*)
FROM wp_posts WHERE post_type = 'product'"
+----------+
| count(*) |
+----------+
| 2105 |
+----------+
}}}
It likely happens because it also includes post attachments here:
https://github.com/WordPress/WordPress/blob/2879b85136044a56fdd908a56c79c85a0ed7a39e
/wp-admin/includes/export.php#L190).
In that code block there's chunking, which is why it works, however, in
the code where it fails there's no chunking.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63503>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list