Proposed rewrite of the standard WordPress exporter.
This proposed rewrite of the standard WordPress exporter:
- Exports WXR 1.3-proposed instances.
- Uses proposed Export & XML APIs.
- The Export API is a modified version of that proposed in Export API.
- Provides hooks that allow plugins to add extension markup to the generated WXR instance, e.g., rows from custom tables that are associated with various content included in the output.
- Provides additional hooks that allow plugins that hook into the 'export filters' action that exists in the standard exporter to do actually something useful with the the 'export filters' they have added.
- Fixes what I consider to be a few bugs in the standard exporter that are unrelated to
any of the above. For example, when exporting posts of a single post type the
standard exporter exports the terms associated with the posts in the
/rss/channel/item/category
element, but does not export the "full" terms. Thus, hierarchical relationship between those terms are not represented (and cannot be produced by the importer), nor are term metas and term descriptions. In this version, the "full" terms are also exported in that case. - Incorporates the UI/UX from WordPress Importer Redux.
The above goals are completely independant of one another. For example, if folks like the WXR 1.3-proposed changes but hate the rest of my changes/fixes then those WXR changes can be encorporated into the standard exporter without any of the other changes.
Generating exports with this plugin wouldn't be very useful if you couldn't also import them (which the WordPress Importer is unable to do). WordPress Importer Redux to the rescue! WordPress Importer Redux not only imports WXR 1.3-proposed instances, but also older WXR 1.0, 1.1 and 1.2 instances.
Want to experiment with the hooks mentions above?
- A "demo" plugin exists that demonstrates the use of most of them. That plugin is available at WordPress Exporter Redux Extension.
- A more realistic "demo" plugin exists that demonstrates exporting and importing custom tables. That plugin is available at P2P Export/Import.
- Install the plugin
- Directly from GitHub. (Download as a ZIP.)
- Via GitHub Updater
- Activate the plugin
- Head to Tools
- Select "Export (v2)"
- Follow the on-screen instructions.
- Limit terms to those whose taxonomy is registered
- Improved log message for exported posts
- Incorporated UI/UX from WordPress Importer Redux
- More extensive export filters
- Compatibility with PHP 5.2
- Added Export API
- Added XML API
- Rewrote to use the Export & XML APIs
- Fixed bug causing $term_ids to be unset when $post_ids is empty
- Fix base/@href for Network admin screens
- Added GitHub Updater plugin header info
- Init commit
- Add more unit tests
- XML API
- Should "intelligently" deal with characters that are outside the range of characters allowed by the Char production in the XML Spec. "intelligently", in this context, means that I'm not sure just stripping them is the correct thing to do, but introducing a WP-specific way of encoding them is also not a good idea (for example, would other CMS's importing a WXR instance know what to do with them?).
- Add XML 1.1 non-terminal checking (once it is verify that all of PHP's XML parsers can correctly handle XML 1.1 instances.
The best way to help with the exporter right now is to try exporting and see what breaks. Compare the old exporter to the new one, and find any inconsistent behaviour.
There is a general feedback thread so you can let us know how it goes. If the exporter works perfectly, let us know. If something doesn't import the way you think it should, you can file a new issue, or leave a comment to check whether it's intentional first. :)
Have comments/suggestions about the markup changes in WXR 1.3-proposed? Head on over there and open an issue.