Export WordPress to XML

Export WordPress to XML

To create an XML feed go to WP All Export › New Export and choose the type of data to export. Drag and drop to select your data, rearrange XML elements, rename them, and customize your feed.

Custom XML vs. Simple XML

With the Simple XML Feed option you drag and drop to rearrange the XML elements. You can change the element names, but true customization is not really possible.

With the Custom XML Feed builder, you literally write out the XML feed by hand. You can nest elements as deep as you want, add elements outside of the looping post element, create custom loops with PHP functions, and more.

This guide covers Simple XML Feed exports, which are sufficient for most uses.

XML Sucks, but WP All Export Makes It Easy

XML stands for Extensible Markup Language. It was designed in 1998 by a group of sadists with the goal of being both human-readable and machine-readable. It often fails on both accounts.

Here's a simple XML export of the default first post created by WordPress:

With a simple XML export you don't have actually write or touch the XML at all.

Export WordPress data to XML

By default, WP All Export generates a CSV file. To change that, go to Export Type › Feed and select Simple XML Feed.

In the Advanced Options section, you can make a variety of changes:

Root XML Element: This is the first XML element that all others are nested inside. In the example above, that would be the element.Single Post XML Element: This is the XML element for each record. In the example above, that would be the element.Enable CDATA tags: Some characters in the data you're exporting might look like XML. CDATA tags are used to distinguish data that could be interpreted as XML markup, but should not be.

Multiple Elements per Field

When your export contains many elements in the same field, they use pipe characters (|) as a separator. For example, multiple images from a WooCommerce product's gallery:

Any exported field that has more than 1 value will have those values separated by a pipe character by default. Here's how a custom field with several values gets exported:

Custom XML Exports

Simple XML feeds can be very limited when it comes to modifying the structure of the data or adding special data into the XML export. Some exports may require special nesting or a different XML structure.

If you need a different XML format, you can use the Custom XML Feed option.

Related Docs

CSV & Excel

Custom XML

Standard Post Data

Filter Exported WordPress Data

Filter Exported WordPress Data

You can configure your filters in the Add Filtering Options section, available when creating and editing exports. If we wanted to export all of our WooCommerce products that cost less than $10, we would first Price as our element to filter by. Then for our rule we would select less than, with 10 for our value.

With these filters you can easily do things like export:

Every WooCommerce order over $100Users who have registered in the last weekAll of the green shirts in your WooCommerce storeEvery page created by a certain userAll of the posts written in 2014

Step 1: Select an Element

Select the element that you want to filter your exported records by. Available elements will change when you export different types of data. You can select any data associated with the records you are exporting, like:

DateTitlePriceOrder TotalAddressAuthorCategories and tagsCustom fieldsAny exportable data

Step 2: Add a Rule

Select which comparison rule you want to use with your filter. You can use any of the following rules, depending on what the selected element allows:

equalsdoesn't equalgreater thanequal to or greater thanless thanequal to or less thancontainsdoesn't containis emptyis not empty

Step 3: Enter a Value

Input the value to filter your data by. You should input values that follow the same format as the element selected in Step 1.

Some rules may not need a value, such as the is empty rule.

Once you're done, click Add Rule to apply your new filtering rule. You can add as many filtering rules as required. After that, only records matching your specified rules will be exported.

Adding Multiple Rules

You can add as many rules as you like. Use the AND or OR operators to specify how rules should interact with each other.

When your export runs again, WP All Export will rebuild your export file based on your filter rules.

How to Send Exported WordPress Data to Zapier

How to Send Exported WordPress Data to Zapier

Zapier acts as a middle man between WP All Export and hundreds of other popular apps. You can automatically add export files to Dropbox or Google Drive, email them somewhere with Gmail, or anything else you can think of. Here's the full list of apps: http://zapier.com/zapbook/wp-all-export-pro/

You can save your WP All Export Pro export files to Google Drive or Dropbox when your export finishes. You can also send your export files via email. Note that Zapier can only process your export file, but not the data contained inside the file.

Connect Zapier and WP All Export

Go to Zapier.com, create an account, and make a new Zap. Then select WP All Export as the trigger app and whatever you want as the action app.

When an export is successfully completed WP All Export will send Zapier some information like the export file』s URL, the post types exported, the number of records in the export file, etc.

When creating your Zap you can set up filters so it only runs when a specific export is completed, or if this is an export of WooCommerce orders, or if it contains more than 100 records, or whatever you want.

Step 1: Customize Your Export

Create and set up your custom WordPress export as desired. In this example, we will send our export file to an email, but the process is the same for any other trigger used within Zapier.

Step 2: Connect With Zapier

In Zapier, select Make a Zap, choose WP All Export Pro as the app, and New Export File as the trigger. Then, click on Continue:

If you haven't linked your WP All Export account yet, Zapier will ask you to sign in. To connect your site to Zapier, you will need your site's URL and your API key, which can be found in All Export › Settings.

Once connected to the correct site, Zapier will ask you to test the trigger with a recent export. After the trigger is set up, you can select the action that will happen whenever there's a New Export File in WP All Export:

Every time that the export runs, the trigger will execute and perform the action as configured inside Zapier. You can learn more about using Zapier: https://zapier.com/learn/getting-started-guide/what-is-zapier/

Export WordPress Images to CSV or XML

Export WordPress Images to CSV or XML

To export images from WordPress to CSV/XML, create a new export with WP All Export and then drag and drop from the Media section to set up your custom file. This process works for WooCommerce product galleries, real estate properties, and more.

Exporting Images from a WooCommerce Product Gallery

When creating a WordPress export, you can choose to export all of the images and files attached to the records you are exporting.

You can see all of the data available for export in the Media section. In this example, we'll export images attached to our WooCommerce products but it is the same process no matter what type of images or attachments you are exporting.

WooCommerce products often have many images attached to them. Multiple images are separated with a pipe character (|) by default. Press Preview to see what your export will look like.

WordPress Image Data Fields Available for Export

URL: The image URL.Filename: The image filename.Path: The location on your server where the image is stored.ID: The image ID.Title: The image title.Caption: The image caption.Description: The image description.Alt-Text: The image alt textFeatured: The URL of this post's featured image.

Attachments have the same available export fields and work in the same way.

Advanced Image Export Options

To edit an export field, click on one of the fields that you've dragged out of Available Data. There you can specify exactly which types of images to export. You can also change the separator used when multiple images per record are exported.

WordPress Export Settings

WordPress Export Settings

To change the settings of an existing export, go to Manage Exports ›  Export Settings. You can change the filtering options, scheduling options, and settings related to the structure of the export file.

These settings can also be adjusted when creating a new export.

Filtering Options

Here you can change existing filters, or add new ones. Your export will apply the new filters when it runs again.

Read more about filtering options: https://www.wpallimport.com/documentation/export-data-filtering/

Scheduling Options

Export can be run automatically on a schedule in a few different ways.

Do Not Schedule: selected by default.Automatic Scheduling: select to use our Automatic Scheduling Service.Manual Scheduling: select to use cron jobs.

Advanced Options

The Advanced Options section contains various settings that control how files are exported and structured.

In each iteration, process X records: Exports are processed in batches. Each batch, or iteration, processes a certain number of records. If the iteration takes longer than your server's timeout setting, then the export will fail. Only export Posts once: Every time the export is run records that have been previously exported by this export will be ignored. Only new records will be exported.Only export Posts that have been modified since last export: Every time the export is run, records will only be included if they have been modified since the last time this export has been run.Include BOM in export file: The BOM, or byte order mark, is required by software like Excel in some cases when special non-English characters are included in the exported data. Create a new file each time export is run: When enabled, WP All Export will generate a new file every time that you re-run the export. The old files will not be removed, and the new file's name will include the time that the export was run.Split large exports into multiple files: Specify the maximum number of records to include in each file. Allow non-admins to run this export in Client Mode: Allow users with access to Client Mode to run this export and download the export file. Read more about Client Mode: https://www.wpallimport.com/documentation/how-to-let-clients-run-wordpress-exports/ Friendly Name: Rename the export, displaying a custom name on the Manage Exports page.

Importing Images From Your Server

Importing Images From Your Server

Importing images that already exist on your server is exactly the same as importing images from a URL, except you only need to specify the file name of the image.

The images you are importing must be uploaded to /wp-content/uploads/wpallimport/files/

The images in this folder will be copied to the paths used by your WordPress Media Library when the import is run – typically, /wp-content/uploads/YYYY/MM/.

Export ACF Picker Fields to CSV or XML

Export ACF Picker Fields to CSV or XML

WP All Export detects all ACF fields in the posts you're exporting. To customize your export file, drag fields from the Available Data › ACF section and drop them into the editor on the left.

The following ACF picker fields are available to be exported: Date Picker, Date Time Picker, Time Picker, and Color Picker. Here's more on each field, along with an example of what's exported:

Date Picker: Exports the date in the format d/m/Y, example: 07/05/2021.Date Time Picker: Exports the date and time in the format d/m/Y g:i a, example: 21/05/2021 7:06 am.Time Picker: Exports the time in the format g:i a, example: 3:03 am.Color Picker: Exports the color in its HEX color code, example: #8224e3.

Developer Options For Extending WP All Import

Developer Options For Extending WP All Import

Using custom PHP code with our API and our Add-On API allows developers to extend WP All Import to work with any theme or plugin. Use snippets with our actions or filters to quickly modify how individual data is imported. Need to call a function after import? There's an action for that.

Related

Custom Code

Code Snippets

Action Reference

Add-On API

Using XPath to Retrieve, Modify, And Filter File Elements

Using XPath to Retrieve, Modify, And Filter File Elements

WP All Import uses PHP's XPath 1.0 support to allow for powerful manipulation of your data file during import. This allows you to quickly group and limit what fields are pulled into a particular field. You can also perform simple text replacement.

Note: Most XPath statements that work directly in the SimpleXMLElement::xpath function will work in WP All Import: https://www.php.net/manual/en/simplexmlelement.xpath.php

Note: All XPath statements used in WP All Import must be wrapped in curly braces or they won't be interpreted as XPath - {elementOrExpression}

Note: If typing text into the import configuration with literal curly braces, the opening curly brace must be escaped with a backslash - {something}

What is XPath?

Officially, 'XPath is a language for addressing parts of an XML document...': https://www.w3.org/TR/1999/REC-xpath-19991116/What that means in practice is that XPath is what's used 'behind the scenes' in WP All Import to group and iterate through the data from your import file. Because of that, you have the opportunity to use custom XPath expressions to manipulate file data during the import.

But How Do I Use It?

Say you have an import file with some image elements like this:

You could drag those elements to the Images section one by one, which is fine if you only have a few and there's always the same number of image elements:

However, what do you do if you have dozens per record and each record could have any number of image elements? That's where the power of XPath can greatly simplify your import configuration.

Here's an XPath statement that would grab all of the images, regardless of number in each record:

{./*[starts-with(local-name(), 'image')]}

It would simply be placed in the Images section:

Additional Resources

https://www.ibm.com/developerworks/library/x-xpathphp/index.html

https://www.w3schools.com/xml/xpath_intro.asp

Related

Inline PHP

FOREACH Loops

IF Statements

Export ACF Relational Fields to CSV or XML

Export ACF Relational Fields to CSV or XML

All available ACF relational fields are automatically detected by WP All Export and added to the ACF section in Available Data.

The following ACF relational fields are available for export: Link, Post Object, Page Link, Relationship, and User. Here's more on each field:

Link: This field allows to select or define a link (URL, title, target) via the WordPress link popup. Exports the link data separated in the fields Link_title, Link_url, and Link_target (if defined). Post Object: This field enables a drop-down list to select posts, pages, or custom post types. Exports the slug of the selected item.Page Link: Similar to the Post Object field, but also allows selecting archive pages. Exports the full URL to the selected item.Relationship: This field stores relationships between posts, pages, or custom post types. Exports the name of the selected items. User: This field allows the selection of a user account. Exports the email address associated with the selected user.

Multiples values exported within the same field are separated by a pipe ( | ) character.