With the Import export suite for WooCommerce plugin, you can import and export products, product reviews, orders, coupons, subscriptions, product categories, product tags and users. In certain cases, based on the warehouse or custom data formats, we might need to change the export data format. This is attained by modifying the export data with code snippets. These code snippets are often put in the active theme’s functions.php file.
In some circumstances, you may not have access to the theme’s functions.php file editor or the theme itself does not have a functions.php file (most block-enabled themes do not have a functions.php file). In this case, you can consider adding a custom code snippet using third-party plugins. However, for our plugin, you have the option of adding the code snippet through the plugin itself to change the export data. This article describes a much simpler method for including the code snippet during the advanced export.
You can simply use the PHP code editor in the plugin to paste your code snippet. The functions will be stored in the wp-content/webtoffee_export/functions.php
file and it will be applied to the data whenever an export is initiated. To begin:
- Install and activate the plugin.
- Navigate to WebToffee Import Export (Pro) > General Settings > General.
- Under Advanced options, enable the option PHP code editor in advanced export.

- Click on Update Settings to save the changes.
- Now, navigate to WebToffee Import Export (Pro) > Export.
- Select the post type as required.
- Select an export method.
- Filter data based on different criteria.
- Map and reorder export columns.
- On the next step, expand Advanced options, under Custom PHP code, paste the code snippet and click on Save functions to update the changes.
This will enhance the plugin’s functionality to achieve the required goal. For a more detailed explanation on how to export various post types, refer to:
- How to export WooCommerce Users/Customers
- How to export WooCommerce products
- How to export WooCommerce product categories
- How to export WooCommerce product tags
- How to export WooCommerce product reviews
- How to export WooCommerce coupons
- How to export WooCommerce orders
- How to export WooCommerce subscription orders