Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46575 closed defect (bug) (fixed)

Issue with WP Export - adding spaces to .xml file

Reported by: juliarrr's profile juliarrr Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.1
Component: Export Keywords: has-patch
Focuses: Cc:



After updating WordPress to 5.1 (or 5.1.1) appeared bug with exporting content. When proceeding to the Tools - Export and downloading export .xml file, it can be seen that it exports content incorrectly. Spaces before and after content are added, and it causes problems with importing this content afterwhile. On the screenshot you can see the difference - content on the left was exported on WP 5.0 and content on the right was exported on WP 5.1: . As you can see there are unneeded spaces that break the content structure after import.

Please fix this problem in the next WP update.
Thank you!

Attachments (1)

46575.diff (759 bytes) - added by sgastard 5 years ago.
Remove blank

Download all attachments as: .zip

Change History (11)

5 years ago

Remove blank

#1 @sgastard
5 years ago

  • Keywords has-patch added

#2 @sgastard
5 years ago

#46656 was marked as a duplicate.

#3 @aristath
5 years ago

  • Component changed from General to Export

Just to add to this, this is not limited to <title> elements. As mentioned on the coding-standards fixes in result in a lot of whitespace that breaks things on imports - both for menu items as well as content using any page-builder.
It's really annoying having to manually edit the exported XMLs to remove whitespace before importing them on another site - and I'm sure not everyone can do that.

#4 @SergeyBiryukov
5 years ago

#46904 was marked as a duplicate.

#5 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.2

#6 @SergeyBiryukov
5 years ago

46575.diff is not enough, running composer format on src/wp-admin/includes/export.php still results in the extra tabs.

Apparently this needs to be adjusted upstream in WPCS:

Version 0, edited 5 years ago by SergeyBiryukov (next)

#8 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45216:

Export: Remove extra whitespace from <title>, <content:encoded>, and <excerpt:encoded> elements in WXR files.

Props sgastard, juliarrr, aristath, SergeyBiryukov.
Fixes #46575.

#9 @ocean90
5 years ago

#47031 was marked as a duplicate.

#10 @ocean90
5 years ago

#47209 was marked as a duplicate.

Note: See TracTickets for help on using tickets.