Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community

Migrating a Website to Craft CMS

Exporting WordPress Posts with the WP All Export Plugin

We use a third party plugin to export WordPress blog posts as XML with custom XML and functions to tweak the output.

WP All Export is a third-par­ty com­mer­cial plu­g­in that sim­pli­fies data export from Word­Press. While some fea­tures are free, the most pow­er­ful ones require a paid license.

Key Fea­tures:

  1. Exports to CSV and XML (no JSON support)
  2. Offers advanced data manip­u­la­tion options
  3. Allows cus­tom func­tions and out­put customization
  4. Avail­able in the Word­Press plu­g­in store

Using WP All Export:

  1. Instal­la­tion:

    • Search for WP All Export” in the Word­Press plu­g­in store
    • Install and acti­vate the plugin
  2. Cre­at­ing an Export:

    • Go to WP All Export in your Word­Press dashboard
    • Choose the con­tent type (e.g., posts)
    • Select fil­ter­ing options if needed
    • Cus­tomize the export file by select­ing desired fields
  3. Cus­tomiz­ing XML Output:

    • Choose Cus­tom XML Feed” instead of Sim­ple XML Feed”
    • Define your XML struc­ture to con­trol the out­put format
    • Use cus­tom func­tions to manip­u­late data (e.g., remov­ing HTML com­ments, adjust­ing sta­tus values)
<data>
	<post>
		<status>{Status}</status>
		<slug>{Slug}</slug>
		<author>{Author Name}</author>
		<date>{Date}</date>
		<PostType>{Post Type}</PostType>
		<title>{Title}</title>
		<content>[remove_html_comments({Content})]</content>
		<excerpt>{Excerpt}</excerpt>
		<category>{Categories}</category>
	</post>
</data>
<?php
function setCraftStatus($statusName) {
	if($statusName == 'publish') {
		return 1;
	}
	if($statusName == 'draft') {
		return 0;
	}
}
  1. Run­ning the Export:
    • Pre­view the export to ensure cor­rect formatting
    • Con­firm and run the export
    • Down­load the XML file or use the pro­vid­ed URL

Import­ing to Craft CMS using Feed Me:

  1. Cre­ate a new feed in Feed Me
  2. Use the WP All Export XML URL as the feed source
  3. Map Word­Press fields to Craft fields:
    • Title, slug, date, sta­tus, author, con­tent, cat­e­gories, excerpt
  4. Set unique iden­ti­fiers (e.g., title and slug)
  5. Run the import process

Key Take­aways:

  • Manip­u­late data dur­ing export rather than after import
  • Cus­tom func­tions in WP All Export can help pre­pare data for Craft CMS
  • Always pre­view and test your export before importing

WP All Export pro­vides a pow­er­ful way to cus­tomize your Word­Press data export, mak­ing it eas­i­er to pre­pare your con­tent for migra­tion to Craft CMS.

Migrating a Website to Craft CMS is made up of the following videos: