WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 days ago

#52180 closed enhancement (fixed)

Add post modified fields to WXR export format

Reported by: jmdodd Owned by: SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version: trunk
Component: Export Keywords: has-patch needs-dev-note
Focuses: Cc:

Description

The WXR export format can be used to merge blogs' content without needing to resort to direct database manipulation. However, its usefulness is limited when doing so because the importer cannot programmatically determine which version of a post is "fresher" as the only date information included with a given post is the post date.

I would like to add the post_modified and post_modified_gmt fields to the generated WXR export file to allow for the possibility of import logic involving updating and adding revisions to, rather than skipping, existing posts/pages.

I have tested these additions with the WordPress importer with no issues in either export or import.

Attachments (1)

52180.diff (901 bytes) - added by jmdodd 3 weeks ago.

Download all attachments as: .zip

Change History (5)

@jmdodd
3 weeks ago

#1 @SergeyBiryukov
3 weeks ago

  • Milestone changed from Awaiting Review to 5.7

#2 @SergeyBiryukov
3 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
3 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49910:

Export: Add post_modified and post_modified_gmt fields to the generated WXR export file.

This allows for more flexibility when determining which version of a post is the latest one, and makes it possible to implement import logic involving updating and adding revisions to existing posts or pages.

Props jmdodd.
Fixes #52180.

#4 @audrasjb
3 days ago

  • Keywords needs-dev-note added

It would be nice to mention this change in the Miscellaneous Changes dev note.

Note: See TracTickets for help on using tickets.