WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 8 months 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: 5.7
Component: Export Keywords: has-patch has-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 10 months ago.

Download all attachments as: .zip

Change History (6)

@jmdodd
10 months ago

#1 @SergeyBiryukov
10 months ago

  • Milestone changed from Awaiting Review to 5.7

#2 @SergeyBiryukov
10 months ago

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

#3 @SergeyBiryukov
10 months 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
9 months 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.