For store managers, the lack of a powerful tool for bulk edit product custom field is a major problem. They have to visit each product’s page to see the meta fields and manually edit each field separately. This is a more challenging task when there are a large number of products in the online shop with various meta fields that need to be edited regularly.
To help you easily edit your custom fields in bulk, in this post, we are going to introduce the following methods:
- Bulk edit WooCommerce products’ custom fields by coding.
- Bulk edit WooCommerce products’ meta fields using the bulk editor plugin.
Continue reading to learn how you can use these methods to bulk edit product custom fields in WooCommerce very fast and easily.
What is a custom field and how you can create it?
WooCommerce custom fields include any type of field such as the following:
- Text field
- Text area
- Drop-down / field selection
- Radio buttons
- Selection boxes
- file upload
- Date fields
- Etc.
These fields are displayed on the product page next to the add to cart button, giving customers more information about each product or letting them upload or insert some information.
To add custom fields in WordPress without a plugin, go to the Screen options section and mark the Custom field checkbox. Doing this will add the corresponding meta box at the bottom of the page.
Then you need to specify the Name and Value and click the Add Custom Field button.
Of course, there are various plugins such as ACF that you can use to do this task with more flexible options.
When the number of products and custom fields you created is large and you want to edit several products at the same time, you need a bulk edit plugin that supports meta fields and is compatible with different plugins you added custom fields with.
You can also add the Custom Field option to the WooCommerce default editor with the help of coding so that you can bulk edit them without a plugin.
In the following, we will show you how to use these two methods to bulk edit product meta fields WooCommerce.
Add meta field to the WooCommerce default editor by coding
If you have already worked with the default editor of WooCommerce, you know that there is no item for bulk editing the custom field in this form. However, you can add this feature by using two hooks:
- The first hook to display the custom field in the editor.
- The second hook to save and store value in WooCommerce.
You need to insert these hooks in the functions.php file of your WordPress theme.
Although, we have some recommendations for you before copy/paste the below code in the Functions.php:
- Use this code only if you are an expert in code writing. Otherwise, please ask an expert to do this task.
- It is a good idea to back up your site before inserting the code
- It makes sense if you create a child theme and then insert the below code in the Functions.php of the new child theme
/**
* @snippet Custom field bulk edit - WooCommerce
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 4.0
* @community https://businessbloomer.com/club/
*/
// Note: change all occurrences of "custom_field" with the key of your custom field
add_action( 'WooCommerce_product_bulk_edit_start', 'bbloomer_custom_field_bulk_edit_input' );
function bbloomer_custom_field_bulk_edit_input() { ?>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php _e( 'Custom Field', 'WooCommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="custom_field" class="text" value="">
</span>
</label>
</div>
<?php
}
add_action( 'WooCommerce_product_bulk_edit_save', 'bbloomer_custom_field_bulk_edit_save' );
function bbloomer_custom_field_bulk_edit_save( $product ) {
$post_id = $product->get_id();
if ( isset( $_REQUEST['custom_field'] ) ) {
$custom_field = $_REQUEST['custom_field'];
update_post_meta( $post_id, 'custom_field', wc_clean( $custom_field ) );
}
}
When you insert and run the code successfully, go to the below address and open the default editor of WooComemrce to see the result:
WordPress Admin > Products > Bulk Edit
For store managers who are not familiar with code writing or for those who expect to have access to a more flexible tool allowing them to filter products based on custom fields or bulk edit them conveniently, we are going to introduce a wonderful product meta fields bulk editor.
Bulk edit product custom field using WooCommerce products bulk Edit plugin
WooCommerce product bulk edit plugin is one of the best product meta fields bulk editors WooCommerce provides useful tools for group editing of products to store managers. Editing individual custom fields and other product specifications is a very time-consuming task, so for big and small stores, this plugin will help site managers save time.
In this plugin, in addition to the possibility of bulk editing of meta fields, there is simultaneous editing of categories, regular and sale prices, short descriptions, stock, tax, shipping class, and many other things for several products.
By using this plugin, you will be able to add multiple fields such as text, password, email, numbers, data vector, selection, multiple selection, control boxes, radio buttons, and file uploads with different functions in the form filter and block edit. Create a form and use them according to your needs. Compatibility with other WooCommerce plugins such as ACF is one of the other features of this plugin.
Let’s review a step-by-step guide for bulk editing custom fields with this plugin.
Step 1: Install product meta fields bulk editor
You can download and install this popular meta fields bulk editor product on your WordPress website. After activating the plugin, go to the following address to open the main page of the plugin:
WordPress Dashboard > iT Bulk Editing > Woo Products
WooCommerce Products Bulk Edit Plugin
The easy way to bulk edit products’ custom fields in WooCommerce
On this page, a list of all WooCommerce products is displayed in a table with a comprehensive toolbar on the top including the most useful tools you need for filtering and bulk editing all WooCommerce fields and meta fields.
Let’s review the tools and options provided in this plugin for product custom field bulk edit WooCommerce.
Step 2: Add custom fields to product meta fields bulk editor WooCommerce
To bulk edit custom meta fields such as text, number, confirmation checkbox, and date in this plugin, you must first click on the Custom Fields option on the toolbar to open the corresponding form:
In this form, there are three methods available for adding or importing custom fields:
Method 1: Add WooCommerce product custom fields Manually
To add WooCommerce meta fields manually, try the below steps:
- Write the custom field Name in the text box of the Manually field and press the + button.
- In the right panel, write a name for the custom field. This name will be displayed in the bulk edit form or filter form of the plugin.
- Choose the custom field type from the list including:
- Text Input
- Text Area
- Checkbox
- Radio
- Array
- Calendar
- Password
- URL
- Image
- File
- Editor
- Select
We completely described all types of custom fields and the way you can customize them, here.
- Set the Value type of the meta field. This item will be changed based on the custom field you have chosen.
By following these 4 steps, you can add as many custom fields as you need. Please, note that you have to add meta fields that are already added to the WooCommerce products. It is not possible to add a new meta field to WooCommerce products bulk editing plugin.
Method 2: Import WooCommerce meta fields automatically from the product
The next method is importing custom fields from one of the WooCommerce products automatically. To do this, you need to:
- Write the product ID in the box.
- Press the + button.
That’s it. The plugin will automatically import all meta fields related to the product and you can see a list of them in the right panel.
It is possible to set a new Name, choose Custom Field Type, and set Value type just like the previous method.
Method 3: Import custom fields from other plugins
The third method allows you to import metadata from a third-party plugin like ACF. If you have already added some custom fields to WooCommerce by using the ACF plugin, you can open the dropdown list of Select box and choose them from the list then press the + button to see it in the right panel.
After adding and customizing the meta fields, press Save Fields to instruct the plugin to show them in the filter form, bulk edit form, and column profile form.
Now, let’s see how you can bulk edit product meta fields WooCommerce in the plugin.
Step 3: Change custom fields of multiple WooCommerce products
As one of the best product meta fields bulk editor, our plugin fully supports bulk editing all types of custom fields. Also, the ability to filter products based on custom fields is another feature of the plugin.
For product custom field bulk edit WooCommerce, you can use one of the following two methods:
Method 1: Bulk edit product meta fields WooCommerce
To bulk change custom fields, you can:
- Filter some products using WooCommerce product bulk edit filter form.
- Select some products in the table.
- Open the Bulk edit form.
- Go to the Custom Fields tab.
- Make the changes you need.
- Press the Do Bulk Edit button.
Method 2: Bind edit product custom field WooCommerce
Bind edit is a quick way to allow you to make changes on custom fields of multiple products directly in the table.
To do this, follow the below steps:
- Open the Column Profile form and mark the meta fields you want to bind edit to add the columns to the table.
- Press the Apply to the Table button.
- Mark some products in the table and press the Bind Edit tool.
- Make changes you need on the custom filed cell of one of the selected products.
- Press the Enter key.
After a few seconds, the plugin will change the meta fields of all selected products as illustrated below:
How to add custom product fields in WooCommerce?
Suppose you want to let WooCommerce add extra fields to the product. In that case, enabling the custom field option is necessary, and then assigning a name and value to add particular information to the product page. Let’s review how you can add WooCommerce custom fields with and without a plugin.
WooCommerce add custom fields to products without a plugin
By following the below instructions, you can add WooCommerce product custom fields without the plugin:
- Log in to the WordPress admin area.
- Open one product page.
- Expand Screen Options and mark Custom Fields.
- Collapse Screen Options and scroll down the page to see the custom fields box.
- In this box, two fields need to be set: Name (e.g. Brand) and Value (e.g. H&M)
- After filling in the custom field Name and Value fields, press the Add Custom Field button
Use the ACF plugin to create custom fields in WooCommerce products
Advanced custom fields (ACF) is one of the most popular WooCommerce custom fields plugins that supports 30 custom field types allowing you to add custom fields to WooCommerce products with few clicks.
You can easily download the plugin from WordPress respiratory and install it on the website.
After installing and activation, you’ll see a new Custom Fields tab appear in your dashboard. Press the option to see the Field Groups page.
Now, you can follow the instructions below to add the custom field to the WooCommerce product:
- Click on the Add New button at the top of the screen.
- Press the Add Field button and pick a label for the new field that is used as its name.
- Choose the Field type such as text, checkbox, or email.
For this example, let’s add an Email field to collect the author’s email address.
- Open Field Type and choose Email from the list.
- Fill the instructions box by writing a text like “Please fill out your email address before publishing your post.” (Optional).
- Enable the Required field if this is a necessary field.
- Set up the Advanced Options like Conditional logic (Optional)
- Click on the Close Field to add custom field to WooCommerce products.
If you want to let WooCommerce add a group of fields to products, simply choose the Add Field button and repeat the process.
Note: In the Location section, you can create a set of rules to determine which edit screens will use these advanced custom fields. If you want to show these custom fields in WooCommerce products you must set “Post Type” equal to “Products”.
WooCommerce Products Bulk Edit Plugin
The easy way to bulk edit products’ custom fields in WooCommerce
Conclusion
By default, WooCommerce cannot bulk edit custom fields of products. Therefore, for bulk edit product meta fields WooCommerce, you should take help from product meta fields bulk editor WooCommerce. In this post, we introduced the WooCommerce Products Bulk Editing plugin and explained how you can use it to edit custom fields. This plugin has many features and capabilities that help store managers edit and manage their products quickly.