How To Export WordPress Comments to CSV or XML

How To Export WordPress Comments to CSV or XML

To export WordPress comments, go to WP All Export › New Export and select Comments. Then, drag and drop your comment data to set up your CSV/XML export file. All relevant comment data is automatically detected.

Export WordPress Comment Data

Comments data is split into four different categories in the Available Data section: Comment Data, Author Info, Parent, and Other.

Basic, commonly used comment data is accessible in Available Data › Comment Data.

ID: The comment ID, assigned by WordPressPost ID: The ID of the post where this comment was madeContent: The main content of the comment Approved: The comment's approval status, with 1 for approved and 0 for not approvedComment Date (Server Time): Date and time when the comment was made, using the timezone that your server is set toComment Date (GMT): Date and time when the comment was made, in GMT/UTC time

Export Comment Author Info

The Author Info section contains all of the information and metadata related to the author of each comment.

Author Name: The name specified by the user when they posted the comment, or the display name of the registered user account if they were logged in when the comment was madeAuthor Email: The email address specified by the user when they posted the comment, or the email address attached to the registered user account if they were logged in when the comment was madeAuthor URL: The URL of the author's websiteAuthor IP: The IP address of the entity that posted the commentAgent: Information describing the web browser used to post the commentUser ID: If the author is registered on your site, this would provide that user's ID (as assigned by WordPress), otherwise, 0 is returned.

WordPress Comment Replies and Parent Posts

The Parent section contains information related to the WordPress parent post where the comment was made, and, if applicable, the parent comment that this comment is a reply to.

Parent Post Slug: The slug of the parent post where the comment was madeParent Post Title: The title of the parent postParent Post ID: ID of the parent post, assigned by WordPressParent Comment ID: The comment ID of the parent that the exported comment is replying toParent Comment Date (Server Time): Date and time when the parent comment was made, using the timezone that your server is set toParent Comment Date (GMT): Date and time when the parent comment was made, in GMT/UTC time

Other Comment Data

The Other section contains automatically detected comment data added by plugins and themes. The Karma field, no longer in wide use, is also stored here.

Export WordPress Custom Fields to CSV or XML

Export WordPress Custom Fields to CSV or XML

To export WordPress custom fields to CSV/XML go to WP All Export › New Export and select the post type you'd like to export. WP All Export will automatically detect the custom fields from your posts. Drag and drop to select fields to export, arrange the spreadsheet columns, and more.

Select WordPress Custom Fields for Export

To select a field for export, click and drag them from the right and drop them on the left. Here we are exporting custom fields from the Yoast WordPress SEO plugin. The custom fields associated with your theme plugin may be different, but they will be automatically detected and accessible in Available Data › Custom Fields:

After dragging fields over, you can click them to access more options for each element. There you can change the column names, combine data from multiple fields, and more.

Confirm And Preview Your Export

You can click Preview to get an idea of how your export file will look. Click Continue to verify your export settings and then run your export by clicking Confirm & Run Export on the next page. This is how our Yoast export looks:

Understanding WordPress Custom Fields

Custom fields are extra information attached to the posts on your WordPress site. They're also known as metadata. Many pieces of data are stored as custom fields, like a product's price or a real estate property's address.

Standard WordPress custom fields are stored as a key/value pair. The key is essentially the name of that custom field. So for a real estate property, the custom field storing the street address might have a key of street_address with a value of 123 Main St. You can learn more about custom fields here: https://wordpress.org/support/article/custom-fields/

There are other types of custom fields as well. Some custom fields can store arrays or serialized information, where one key will have multiple values. Custom fields can also be created by plugins like Advanced Custom Fields (also known as ACF), Toolset Types, and more.

Custom XML Feeds for WordPress

Custom XML Feeds for WordPress

To create a custom XML feed go to WP All Export › New Export and select the post type that you want to export. Using WP All Export's custom XML syntax, customize your feed and generate your XML file.

Custom XML vs. Simple XML

With a Custom XML Feed export, you have complete and total control over the structure of the XML file. You literally write the XML feed by hand and can nest elements as deep as you want, add elements outside of the looping post element, create custom loops with PHP functions, and more.

The Simple XML Feed builder uses drag and drop to rearrange the XML elements. You can change the element names, but deep customization is not possible.

How to Build a Custom WordPress XML Feed

In the Export Type section, select Feed › Custom XML Feed:

Select Custom XML Feed

This will reveal the XML Editor, where you'll build your custom XML feed:

Custom XML Editor

To add export elements to the feed, you can drag-and-drop them from the Available Data section on the right side. If you want to add all of the elements from a certain sub-section under Available Data, simply drag the top element, like All Standard, into the XML Editor. After adding your elements, you can use the Preview button to see what your feed looks like with real data.

Everything between and will be repeated for each exported post, and there can only be one loop. You have complete control over the XML output and can manually edit any part of the XML feed in the editor.

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. By default, WP All Export will automatically add CDATA tags around any content that requires it. In the Advanced Options section you can choose to disable this functionality.

Repeating Fields and Arrays

Some fields, like images, have multiple values per post. WP All Export turns these fields into indexed arrays. Whenever WP All Export encounters an indexed array in an XML element it will repeat that element once for every value in the array.

For example, let's assume a post as two images attached to it: image1.jpg and image2.jpg. We want to have one XML element for every image URL. Here's what our XML template will look like:

     {Image URL}

And here's how our exported XML file will look:

     http://example.com/image1.jpg
     http://example.com/image2.jpg

WP All Export will do this with all indexed arrays that it comes across. So if you have a function that returns an indexed array, that XML element will be repeated for each value. Likewise, you can take a field like {Image URL} and turn it into a string, like this:

[implode("|",{Image Title})]

And you'll just get one XML element with all of the values, like this:

Image 1|Image 2

Using PHP Functions in a Custom XML Feed

Just like other export types, you can use custom or native PHP functions on export elements in a Custom XML Feed. The syntax is:

[function_name({Export Element})]

You can pass multiple export elements to your function if necessary.

This allows you to modify data on-the-fly, or output your own XML in the export feed. Just keep in mind that you must disable CDATA tags if you're outputting your own XML via PHP.

Related Docs

Simple XML

CSV & Excel

Standard Post Data

Export WordPress Data to a Custom Spreadsheet

Export WordPress Data to a Custom Spreadsheet

To create a new spreadsheet export go to WP All Export › New Export and select the type of posts to export. Drag and drop to select your data, rearrange columns, rename them, and customize your file. There are three types of spreadsheets available: CSV, Excel (XLSX), and Excel (XLS).

CSV WordPress Exports

Go to Export Type › Spreadsheet and select CSV File from the drop-down.

CSV stands for Comma Separated Values. Data is stored in plain text, with commas separating each column. CSVs are the most flexible and widely used type of spreadsheet. They can be opened and edited in any text editor, as well as spreadsheet software like Excel, Google Sheets, Numbers, and LibreOffice:

The posts you export will each be on their own row in the CSV file. Each export element will appear as a column in your CSV file. If the data has spaces or line breaks, WP All Export will automatically wrap the value in quotes to make it valid. Keep in mind that data with line breaks may look broken if you open the file in a text editor, but it's not. The quotes allow spreadsheet software to put all of the line breaks and spaces in a single column.

In the Advanced Options section, you can change the delimiter from commas to something else for your CSV file, and you can choose whether or not you want to include the header row.

Excel WordPress Exports

When creating a new export you can choose Excel (XLS) or Excel (XLSX) as the file type. This file type is specifically for Excel and the data is not stored in plain text.

Just like CSV exports, each record will be stored as a row and each export element will be a column in your file.

Customizing Your Spreadsheet

When exporting your WordPress data to Excel or CSV, you can add elements by dragging them in from the Available Data section on the right:

You can also add individual fields, add all fields, clear fields, and preview the export using the buttons below the export template box.

After adding fields, you can drag and drop them to arrange the columns in any order that you'd like. If you want to remove an export element, simply drag it out of the export box and drop it.

To change the column name, click on a field that has been dragged into your export to access the Edit Export Field modal:

Related Docs

Simple XML

Custom XML

Standard Post Data

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

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.

Export Standard WordPress Post Data to CSV or XML

Export Standard WordPress Post Data to CSV or XML

All posts have a set of standard data, like title, content, publish date, etc. To export this data, create a new export with WP All Export and then drag and drop to set up your export file.

Standard Data Fields

ID: The post ID, a unique number given to every post in WordPress.Title: The title of the post.Content: The main post content.Excerpt: A summary of the post content.Date: The date the post was published, in y-m-d format.Post Type: The post type of the exported records.Permalink: The URL of the post.

Besides exporting standard post data, you can also export media, taxonomies, custom fields, and more. You can see those elements below on the right:

Other custom post types like WooCommerce products or real estate properties will have different types of data available for export. Plugins that add custom data to posts, like Yoast or ACF, are automatically added to Available Data.

Each post in your export is a row in your CSV. The fields you drag in are columns. You can click the Preview button to see what your export file looks like.

Preview to make sure your WordPress CSV/XML export is correctly configured.

How To Export WordPress Users to CSV or XML

How To Export WordPress Users to CSV or XML

To export WordPress users go to WP All Export › New Export and select Users. Then drag and drop to set up your CSV/XML, including automatically detected custom user data.

Select WordPress User Data to Export

Drag and drop elements from Available Data into the export editor on the left to add them to your export file. You can click the Preview button to see what your export file looks like.

User data is into four different categories: Standard, Address, Custom Fields, and Other.

Exporting Standard WordPress User Data

Data describing the user's WordPress user account are found Available Data › Standard:

ID: The user ID, assigned by WordPressUsername: The username the user chose when creating their accountUser Email: Email address associated with the user accountFirst Name: User's first nameLast Name: User's last nameUser Registered: Date that the user registeredUser Nicename: Sanitized version of the usernameUser URL: Website associated with the user accountDisplay Name: The name to be displayed publicly, which is selected in WordPress as either the username, first/last, or nicknameNickname: A name chosen by the user to be displayed on the frontendDescription: A description of the user, also labeled as Biographical Info in WordPress

Exporting WordPress User Address Data

By default, WordPress does not include billing and shipping address data fields. Installing and activating WooCommerce adds these fields to all users on your site.

With WooCommerce, each user account has two identical sets of address data, one for shipping and one for billing:

First NameLast NameCompanyAddress 1Address 2CityPostcodeCountryStateEmailPhone

Exporting WordPress User Custom Fields

Custom fields are extra information attached to the users on your WordPress site. They're also known as metadata. Many pieces of data are stored as custom fields, like a product's price or a real estate property's address.

By default, users will not have any custom fields attached to them. Plugins and themes, however, will add them. In fact, this is how WooCommerce adds the billing and shipping addresses to user accounts. WP All Export knows about those custom fields, so it moves them to the Address section. WP All Export will automatically detect other custom fields, and add them to Available Data › Custom Fields.

Other User Data

Here you can find other less common user fields, such as:

User Role: All users have a role that determines what they can do when logged in. You can read more about user roles here: https://wordpress.org/support/article/roles-and-capabilities/User Pass: A hash of the user's password. Read on for more on user passwords.And everything else. There's a lot of user data that the vast majority of people will never need to export. In case you do, it's all here.

Exporting WordPress User Passwords

To export a WordPress user password, include the User Pass export field from Available Data › Other.

These are hashes of the passwords, not the passwords themselves. Hashing is a one-way action that irreversibly scrambles a string of text. It is not possible to reverse the hashing process and reveal the original password. You can, however, import the hashed passwords back into WordPress and users will be able to log in with their old password.

Export Posts With Their Taxonomies

Export Posts With Their Taxonomies

To export your WordPress data with their taxonomies, go to WP All Export › New Export and select the post type you'd like to export. Then, drag and drop your taxonomy data to set up your export file. WP All Export will automatically detect all categories and tags attached to your posts.

Understanding WordPress Taxonomies

Taxonomies are used in WordPress to group posts, products, and other post types together based on relationships. By default, WordPress posts have two taxonomy types: Categories and Tags.

Plugins and themes can also add their own custom taxonomies. For example, a real estate plugin might create a custom taxonomy called Property Type, with terms like House and Apartment. An e-commerce plugin might create a custom taxonomy called Brand, with a separate term for each brand of product available.

Read more about taxonomies here: https://wordpress.org/support/article/taxonomies/

Exporting Posts with Their Taxonomy Data vs Exporting Taxonomies Directly

WP All Export offers two ways to export taxonomy data: export the posts with just the term name, or export taxonomies directly with all of the term data but without the posts they are attached to.

This guide focuses on exporting posts and their attached categories and tags.

Select WordPress Categories and Tags to Export

The taxonomies available for export depend on the post type that you have chosen to export. WP All Export will automatically detect all of the taxonomy types that are available. WordPress posts have two by default:

CategoriesTags

Other post types, like WooCommerce Products, will have slightly different ones:

Product categoriesProduct tags

After dragging and dropping the term meta and organizing your export, click the Preview button to see how your file will look.

How to Export WooCommerce Products to Google Merchant Center

How to Export WooCommerce Products to Google Merchant Center

To export products to Google Merchant Center go to All Export › New Export and select WooCommerce Products. Then, change the Export Type to Feed › Google Merchant Center Product Feed and configure the export as required. The exported file is automatically set up for the Google Merchant Center.

Change Export Type to Google Merchant Center Product Feed

When editing a WooCommerce product export, change the Export Type to Feed and select Google Merchant Center Product Feed.

The edit export page will then change to show the Google Merchant Center options:

Fields under Available Data can be used when selecting Custom Data. Inline PHP can also be used.

Basic Product Information Section

Basic product information to export can be defined here:

Item Title: Product title to export, the default option uses the product's current title, but Custom data can be used. This field has a checkbox to make variable products use their parent product title.Item Description: Product description to export, the default option uses the product description, but the short description or Custom data can also be used. This field has two checkboxes controlling what descriptions should be included for variable products.Link: Product link to export. Select between using the product's permalink or Custom data. This export field has a checkbox that adds variation attributes to variable product URLs.Main Image Link: Main image for the product. Select to use the current product featured image or to use Custom data. This export field has two checkboxes to define how images are handled for variable products.Additional Image Link: Secondary product images to export. Select to use current images in the product gallery, or Custom data.

Under Advanced Options, define the following export fields:

Item ID: Unique item ID used to identify products.Item Condition: Condition of the item being sold. Accepted values are new, refurbished, and used. This export field allows using Data Mapping. Exports new by default.Mobile Link: used to define a mobile-friendly version of the same product.

Availability & Price Section

Here's more on the available settings:

Price: Price for the product. The default option uses the current price, but Custom data can also be enabled. This export field has an Adjust Price setting which allows to mark up the price by a percentage or a fixed amount.Sale Price: Sale price for the product. The default option uses the current sale price, but Custom data is available. This export field also has an Adjust Price setting.Availability: Stock for the product. The default option uses WooCommerce stock values, but Custom data can also be used.

Under Advanced Options, change the Currency setting (to any currency supported by WooCommerce and GMC) and modify the following export fields:

Availability Date: Used to define when an anticipated or delayed product will be available. Accepted format: YYYY-MM-DDThh:mmZ. Example: 2021-03-24T13:00-0800.Sale Price Effective Date: Used to define for how long a sale price will be shown to users. Accepted format: YYYY-MM-DDThh:mmZ, separated by a slash (/). Example: 2021-02-24T13:00-0800/2021-02-29T15:30-0800.Cost Of Goods Sold: Used when reporting conversions with cart data to get reports on gross profits. Can be a rough estimate. Accepted format: number plus currency. Example: 10.01 USD.

Product Categories Section

Under Product Categories change how the categories are assigned to the exported products. The following settings are available:

Product Type: Used to include a different product categorization system. Select either Use WooCommerce's product category or Custom data.Product Category: There are 3 available settings to define how product categories are exported:Map WooCommerce's product categories to Google's product categories: This allows to manually map the WooCommerce categories into Google's product categories. Default option.Use WooCommerce's product categories: Uses the existing WooCommerce categories to import into Google Merchant Center. Custom data: Allows defining categories dynamically.

Unique Identifiers Section

Unique Identifiers are unique codes and values used to classify the exported products. Learn more about this here. These are the available settings:

GTIN: Product』s Global Trade Item Number. Supported values: UPC, EAN, JAN, ISBN, or ITF-14. Example: 3234567890126.MPN: Product』s Manufacturer Part Number. Example: SO1234FLYY.Brand: Product's brand name. Example: Soflyy.Identifier Exists: Used to indicate whether or not the unique product identifiers are available for the product. Supported values: yes or no. Available settings: Set to false if product has no GTIN or MPN or Custom data.

Detailed Product Attributes & Item Grouping Section

This section contains settings to define how variable products are grouped, as well as how attributes are exported. Here are the available settings:

Under Item Group ID, define how to group exported variable products. Each variant is exported as a separate product and assigned the same identifier. Choose between either Automatically set the item group ID or Custom data.

The following attributes can be defined when exporting products to the Google Merchant Center:

Color: Select an existing WooCommerce product attribute, choose to Leave Blank, or use Custom data.Size: Select an existing WooCommerce product attribute, choose to Leave Blank, or use Custom data.Gender: Select an existing WooCommerce product attribute, choose to Leave Blank, autodetect or select from WooCommerce product categories, or use Custom data.

More detailed product attributes can be defined under Advanced Options. Here's the available settings:

Size Type: Used to describe the cut of the product. Supported values: regular, petite, plus, tall, big, or maternity.Size System: Country sizing system selected. Exports as blank by default. Supported values: AU, BR, CN, DE, EU, FR, IT, JP, MEX, UK, US.Age Group: Used to set the demographic that the product is designed for. Select from WooCommerce product attributes, choose to Leave Blank, select from WooCommerce product categories, or use Custom data. Supported values: newborn, infant, toddler, kids, or adult.Material: Used to describe the main fabric or material the product is made of. Select from WooCommerce product attributes, choose to Leave Blank, or use Custom data.Pattern: Used to describe the pattern or graphic print found on the product. Select from WooCommerce product attributes, choose to Leave Blank, or use Custom data.

Shipping Section

The Shipping section allows modifying the product's shipping information. Here's more on the available settings:

Shipping Price: This estimated amount allows Google to provide a shipping estimate for the product. This export field has an Adjust Shipping Price setting.Length, Width, Height: This selects the length, width, and height for the product. By default, it will use WooCommerce's product values and convert them to cm, but Custom data can also be used.Shipping Weight: Exports the shipping weight for the product, the default option selected is Do not include in the feed. Allows using WooCommerce's product values or Custom data.Shipping Label: Used to group products together so specific shipping rates can be configured in GMC. Expects a string or plain text.

Advanced Attributes Section

This section contains additional settings that can be applied onto the exported products. Here's more on each one:

Under Product Type define the following export fields:

Multipack: Used to indicate that multiple identical products have been grouped for sale as one product. Expects a numerical value.Adult: Used to indicate that an individual product is for adults only, because it contains adult content such as nudity, sexually suggestive content, or is intended to enhance sexual activity. Supported values: yes, true, no, false.

Adwords & Shopping Campaigns allows defining the following:

Adwords Redirect: Used to specify additional landing page parameters (used for Shopping ads) on the product page. Expects a URL. Custom Labels: Used to create specific filters to use in Shopping campaigns. Learn more here. Expects a string or plain text.

Unit Prices allows to define pricing for products that rely on unit pricing:

Unit Pricing Measure: Used to define the measure and dimension of the product. This value allows users to understand the exact cost per unit for the product. Expects a positive number plus unit. Example: 750ml.Unit Pricing Base Measure: Allows to include denominator for unit price. For example, even if the product is 750ml, users may be interested in seeing the price per 100ml. Expects a positive number plus unit.

There are Additional Attributes that can be defined at the end of this section:

Expiration Date: Used to cause a product to stop showing on a specific date (before the 30 days default). Expects a date, time, and timezone. Format: YYYY-MM-DDThh:mmZ. Example: 2021-02-24T00:30-0800.Energy Efficiency Class: Used to tell users the energy label of the product. Supported values: A+++, A++, A+, A, B, C, D, E, F, G.Promotion ID: Used to match products to promotions. Supports alphanumeric values, underscores, and dashes.

Preview Exported GMC Feed

After the Google Merchant Center Product Feed Export has been configured, click Continue and then click on Confirm & Run Export. Download the exported products by clicking on the Export Feed URL.

Here's a sample preview of a default Google Merchant Center Product Feed export: