Combine and Process Multiple Data Elements into a Custom Export Field
Custom export fields can be used to combine any number of data elements, function calls, and static text into the same export field.
Create a Custom Export Field
To create a custom export field, click Add Field and select Custom export field.
After selecting Custom export field, drag elements from the Available Data section on the right into the export field editor on the left. Unlike normal export fields, you can combine multiple fields together. For example, you can drag the First Name and Last Name elements to create a Full Name in a users export.
Here's the result:
Using Static Data
You can include any type of static text or data required in your export. For example, you can include the currency symbol next to your prices when exporting products.
Here's the result:
That's it!
Export WordPress Data to any CSV, XML, or Excel
- Any theme or plugin
- Images & galleries
- Custom fields
- Zapier integration
- Woo, ACF, Meta Box, JetEngine
Using PHP functions
You can use functions directly inside the Custom export field. Moreover, you can call functions with as many arguments as required.
Following the previous example, you can use a function to apply a 20% discount if the product price is above 100 USD and the product category is clothing. This function would take in two parameters: a price and a category.
Here's the result:
Please note that you need to use double quotes when passing static data to any PHP function. Here are some examples:
[my_get_field({_events_array},"time-start-hour")]
[str_replace("Shirt","T-Shirt",{Title})]
Related Docs
Execute custom code to modify the export data on the fly.
Use the WordPress Query class to fetch posts directly from the database.
Export custom fields from any theme or third-party plugin.
Use WP All Export and the ACF Export Add-On to export fields from the Advanced Custom Fields plugin.