Your products may need details or personalization options beyond the standard name, price, and description. WooCommerce custom fields help you display information such as material composition and compatibility notes, or collect customer input like engraving text with the right setup.
In this guide, we’ll walk you through the steps to add WooCommerce custom fields:
- Choose your method: Built-in fields, a plugin, or custom code.
- Create your fields: Define their names, types, and settings.
- Add your data: Enter product details or configure fields for customer input.
- Set up the display: Place fields or their values where shoppers need them.
- Test the results: Check that values save and display correctly, including cart and order data where relevant.
Keep reading to learn the detailed tutorial!
What Are WooCommerce Custom Fields?
WooCommerce custom fields let you store additional information about your products, customers, or orders beyond the standard fields. You can use them to display a product’s warranty, collect engraving text from shoppers, or request delivery instructions at checkout.
The setup depends on who enters the information and where you need it. There are 3 common uses:
- Product information fields: You enter details such as care instructions, specifications, or warranty information in the admin area, then display them on your product pages.
- Customer input fields: Shoppers enter text, upload files, or select extra options before adding a product to their cart. These are commonly handled by product add-ons plugins.
- Checkout and account fields: Customers provide additional information during checkout, registration, or account updates.
Unlike product attributes, custom fields don’t define variations or appear in shop filters by default. Attributes suit predefined characteristics, such as size or color. Custom fields hold additional product details, such as care instructions, or collect customer information, such as engraving text, through a suitable plugin or custom setup.
How to Add WooCommerce Custom Fields Using Built-In Features
WooCommerce lets you add basic product metadata through the built-in WordPress Custom Fields panel. This method works well for details you enter yourself, such as warranty information or care instructions. The steps below apply to the classic product editor.
Step 1: Enable the Custom Fields panel
In your WordPress dashboard, you can go to Products > All Products and open a product for editing. The Screen Options tab at the top right contains a Custom Fields checkbox. Once selected, the Custom Fields panel becomes available below the product editor.
Step 2: Add a field name and value
In the Custom Fields panel, you can select Enter new if needed, then enter:
- Name: A consistent key, such as warranty_period.
- Value: The information for this product, such as 2 years.
The Add Custom Field button adds the entry. You can then click Update, or Publish for a new product, to save your changes. This stores the information but does not automatically display it to shoppers.

Step 3: Display and test the field
For a classic WooCommerce product template, you can add the following snippet to your child theme’s functions.php file, inside its existing PHP section. A backup and staging test are recommended before editing.
function le_display_product_warranty() {
if ( ! is_product() ) {
return;
}
$product_id = get_queried_object_id();
$warranty = get_post_meta(
$product_id,
'warranty_period',
true
);
if ( '' !== $warranty ) {
echo '<p class="product-warranty"><strong>Warranty:</strong> '
. esc_html( $warranty )
. '</p>';
}
}
add_action(
'woocommerce_before_add_to_cart_form',
'le_display_product_warranty'
);
This follows WooCommerce’s documented hook approach to display the saved value before the add-to-cart form. The field key in the snippet must match the name entered in Step 2.
Your product page should now show Warranty: 2 years. If your product template uses blocks or a page builder, the display method may need to match that setup.
How to Add WooCommerce Custom Fields Using Plugins
The built-in Custom Fields box works for a few simple details, but it has clear limits: every field is plain text, you have to type field names by hand for each product, and customers can’t fill in anything. Plugins solve both problems, but each one is built for a different type of field. The key difference is who fills in the field:
- You, the store owner: fields store product information, such as specs or warranty details, and are filled in from the admin area. Compared to the built-in Custom Fields box, plugins give you proper field types (dropdowns, dates, images), required fields, and rules for which products show them.
- Your customers: fields appear on your storefront, such as a product page or checkout form, and collect information from shoppers, like engraving text or a VAT number.
A plugin built for one type usually can’t handle the other, so choose based on the fields you need:
| Plugin | Who fills it in | Best for | Price |
| Advanced Custom Fields (ACF) | Store owner | Product specs, care instructions, warranty details | Free (Pro available) |
| Advanced Product Fields for WooCommerce | Customers | Personalization and extra product options | Free / Premium from $69 per year |
| Custom Fields for WooCommerce by Addify | Customers | B2B and customer account details | $79 |
| Custom Fields Manager | Customers | Managing customer fields across multiple pages | $69 |
For the walkthrough below, we’ll use ACF for product information and Advanced Product Fields for customer input, since both have free versions.
Option 1: Add product data fields with ACF
First, you’ll need to install ACF. In your WordPress dashboard, go to Plugins > Add New Plugin, search for “Advanced Custom Fields”, then install and activate it.

Hover over ACF in your dashboard menu, select Field Groups, and click Add New. Give the group a clear name, such as “Product Details”.
Set a label (for example, “Warranty Period”) and choose a field type, such as Text, Number, or Select. ACF generates the field name automatically.
Under Location Rules, set Post Type is equal to Product, then save the field group.
Open any product. The new fields now appear on the edit screen, ready for you to fill in.
Option 2: Add customer input with Advanced Product Fields
To get started, go to Plugins > Add New, search for “Advanced Product Fields for WooCommerce”, then install and activate it. Next, go to WooCommerce > Product Fields and create a new field group.

Inside the group, add the fields you need, such as a text box for engraving or a checkbox for gift wrapping, and set an extra price for any option that costs more. Then assign the group to specific products or categories and save your changes.
The fields now appear on your product pages, above the Add to Cart button. Whatever customers enter is added to the cart and saved with the order.
How to Add WooCommerce Custom Fields Programmatically
For those who want complete control over how custom fields are added to their WooCommerce products, adding fields programmatically is the way to go. This method is perfect for developers or tech-savvy users comfortable writing PHP code and modifying theme files. Thus, it keeps your site lightweight and avoids relying on third-party tools.
Step 1: Create a function to add custom fields
First, you’ll want to add a function that defines your custom fields. You can add this code to your child theme’s functions.php file or use a site-specific plugin for custom code.
Here’s a sample function to add custom fields to the product data panel in the WooCommerce backend:
function my_custom_product_fields() { global $woocommerce, $post; echo '<div class="options_group">'; // Text Field woocommerce_wp_text_input( array( 'id' => '_custom_product_material', 'label' => __('Product Material', 'woocommerce'), 'placeholder' => 'e.g., 100% Cotton', 'desc_tip' => 'true', 'description' => __('Enter the material used for this product.', 'woocommerce') ) ); // Number Field woocommerce_wp_text_input( array( 'id' => '_custom_product_weight', 'label' => __('Product Weight (kg)', 'woocommerce'), 'placeholder' => 'e.g., 1.5', 'type' => 'number', 'desc_tip' => 'true', 'description' => __('Enter the weight of the product in kilograms.', 'woocommerce'), 'custom_attributes' => array( 'step' => '0.1', 'min' => '0' ) ) ); echo '</div>'; }
Explanation:
- The
woocommerce_wp_text_input()function is used to add text and number input fields in the WooCommerce product data panel. - The id attribute uniquely identifies each field, while label and description provide context to the user.
- The custom fields are wrapped inside an HTML <div> with the class
options_groupto group them appropriately in the WooCommerce interface.
Step 2: Save the custom field data
Once the fields are added, you need to save the input data when a product is updated. Use the following code to save custom field values:
function save_my_custom_product_fields($post_id) {
// Save the Product Material field
customproductmaterial=isset(_POST['_custom_product_material']) ? sanitize_text_field($_POST['_custom_product_material']) : '';
update_post_meta($post_id, '_custom_product_material', $custom_product_material);
// Save the Product Weight field
customproductweight=isset(_POST['_custom_product_weight']) ? sanitize_text_field($_POST['_custom_product_weight']) : '';
update_post_meta($post_id, '_custom_product_weight', $custom_product_weight);
}
add_action('woocommerce_process_product_meta', 'save_my_custom_product_fields');
Explanation:
- The
sanitize_text_field()function is used to sanitize the input data, ensuring it is safe for storage and display. update_post_meta()updates the product metadata with the sanitized input values, saving them in the WordPress database.
Step 3: Display the custom fields on the product page
To display the saved custom fields on the product page, use the following code in your theme’s single-product.php file or add it to your child theme’s functions.php:
function display_my_custom_product_fields() {
global $post;
// Retrieve the custom field values
customproductmaterial=getpostmeta(post->ID, '_custom_product_material', true);
customproductweight=getpostmeta(post->ID, '_custom_product_weight', true);
// Display the values if they are not empty
if (!empty($custom_product_material)) {
echo '<p class="custom-field">Material: ' . esc_html($custom_product_material) . '</p>';
}
if (!empty($custom_product_weight)) {
echo '<p class="custom-field">Weight: ' . esc_html($custom_product_weight) . ' kg</p>';
}
}
add_action('woocommerce_single_product_summary', 'display_my_custom_product_fields', 25);
Explanation:
- The
get_post_meta()function retrieves the custom field values from the database. - The
esc_html()function is used to escape HTML output, ensuring data is displayed safely on the frontend. - The
woocommerce_single_product_summaryhook places the custom field information below the product summary on the product page.
Step 4: Validate and sanitize input
It’s crucial to validate and sanitize user input to protect your site from potential security vulnerabilities, such as cross-site scripting (XSS). Always use built-in WordPress functions like sanitize_text_field() and esc_html() to sanitize data before saving or displaying it.
For example, you can copy code below:
// Sanitize and save input customproductmaterial=isset(_POST['_custom_product_material']) ? sanitize_text_field($_POST['_custom_product_material']) : '';
But, always remember that security is a top priority when dealing with user-generated input so you should make sure to test your code thoroughly.
Step 5: Testing your custom fields
Here are the steps involved:
- Go to your WooCommerce products and check the new custom fields under the product data panel.
- Input data in the custom fields and save the product to ensure the values are stored correctly.
- Visit the product page on the frontend to confirm that the custom field values are displayed properly.
- Verify that there are no PHP errors or warnings and that your data is sanitized and displayed securely.
So as you can see, adding custom fields without using a plugin provides greater flexibility and control over your WooCommerce store. While this method requires some coding knowledge, it ensures your site remains lightweight and optimized.
Bonus: Import and Export WooCommerce Custom Fields
If you manage a large catalog, importing and exporting WooCommerce custom fields can save you from entering product details individually. You can use a CSV file to move existing field values between stores or update information across multiple products, such as warranty periods and care instructions.
Your CSV can use the same column format for a native import. Under Products > All Products > Import, you can upload the file and review the column mapping. Any custom metadata column that isn’t recognized automatically should be mapped to Import as meta.
For CSV files coming from another system, you can also import your data into WooCommerce through our LitExtension automated tool. With over 15 years of migration experience, we have simplified the entire process so you don’t have to add records one by one or write custom import code. You can get started in five steps:
- Migration setup: You select Files as the source and WooCommerce as the target, then connect your destination store.
- File preparation: You upload your CSV and review the field mapping under Prepare Data, including any custom fields that require specific handling.
- Data check: The Data Check results highlight errors or skipped records so you can correct your file and check it again.
- Migration configuration: You select Products and configure the available migration options.
- Demo and full migration: You can run a demo to review the results before proceeding with the full import.
If your plugin-managed custom fields require additional mapping or customized handling, our All-in-One Migration Service lets you leave the technical work to us.
Let Our Experts Handle Your Store Migration!
With the All-in-One Migration Service, our experts take care of everything, ensuring a seamless and stress-free migration.

Common WooCommerce Custom Fields Problems and Fixes
If your custom fields aren’t working as expected, the first step is to identify where the problem occurs: in the product editor, on the storefront, or during checkout.
Custom fields don’t appear in the product editor
A missing field usually points to an editor setting or a field group that hasn’t been assigned correctly.
How to fix:
- For built-in fields, you can open the product in the classic editor and check Screen Options > Custom Fields.
- For ACF fields, you can open ACF > Field Groups and confirm that the group is active and saved.
- The location rules should match your product. For the example above, the rule should be Post Type > is equal to > Product.
- After saving the settings, you can reload the product editor and check for the field again.
Field values don’t save after updating a product
The field may have failed validation, or custom code may be saving a different key from the one used by the input.
How to fix:
- Check for validation errors, including missing required fields or an incorrect data format.
- Confirm that the input name and saved meta key match in your custom code.
- Save a simple test value and reload the editor to check whether it persists.
- Test for plugin conflicts on staging if the issue continues.
Saved fields don’t appear on the product page
Saving a custom field doesn’t automatically display it. The storefront needs a display method that retrieves the correct value.
How to fix:
- Confirm that the product contains a saved field value.
- Check that your display code or integration references the correct field key and product.
- Use a display method compatible with your theme or product template.
- Clear the relevant page cache after correcting the setup.
Customer input is missing from the order
A visible input box doesn’t guarantee that its value reaches the order. The submitted information must pass through the cart and be saved against the correct order item.
How to fix:
- Enter a test value and check whether it appears in the cart.
- Review the input capture settings or code if the value is missing.
- Check the order-saving implementation if the value disappears after checkout.
- Verify the intended output in the order details and emails.
Fields appear on the wrong products or variations
Broad or missing assignment rules can show fields on unintended products. Variation-specific fields also need a setup that targets individual variations.
How to fix:
- Review the field group’s product and category conditions.
- Narrow broad rules to the intended products.
- Check whether the field belongs to the parent product or individual variations.
- Test several products and switch variations to verify the display.
Checkout fields disappear after switching to blocks
Fields created for classic checkout may not work with the Checkout block. Your plugin or custom implementation needs to support the checkout type in use.
How to fix:
- Check whether the Checkout page uses a block or the classic shortcode.
- Confirm compatibility in your field plugin’s documentation.
- Use WooCommerce’s Additional Checkout Fields API where appropriate for a custom block implementation.
- Place a test order on staging to verify that the field appears and its value is saved.
WooCommerce Custom Fields: FAQs
Does WooCommerce have custom fields by default?
Yes. WooCommerce supports custom fields through WordPress’s built-in custom fields feature. You can use them to store additional product information, such as specifications, warranty details, or internal notes. However, displaying these fields on product pages may require custom code or a plugin.
How to customize WooCommerce checkout fields?
You can customize WooCommerce checkout fields using a checkout field editor plugin or custom code. For stores using the classic checkout, plugins can help you add, remove, reorder, or edit fields without coding. If your store uses the Checkout Block, make sure the plugin supports block-based checkout.
How to make a custom field in the WooCommerce products page?
To add a custom field to a WooCommerce product:
- Go to Products > All Products and edit a product.
- Enable Custom Fields in the editor’s preferences if the option is available.
- Find the Custom Fields section and click Add New.
- Enter the field name and value, then save your changes.
To display the field on your storefront, you may need a plugin or custom code.
Can custom fields add an extra charge to a product?
Yes, but standard WooCommerce custom fields do not automatically change product prices. You can use a plugin like WooCommerce Product Add-Ons to charge customers for extra options, such as gift wrapping, engraving, or personalized messages. Depending on the plugin, charges can be fixed, quantity-based, or percentage-based.
Can I import and export WooCommerce custom fields?
Yes. WooCommerce’s built-in CSV importer and exporter support custom product metadata.
- Export: Go to Products > All Products > Export and select Yes, export all custom meta.
- Import: Go to Products > All Products > Import, upload your CSV file, and map custom metadata columns using the meta: prefix.
For more complex custom fields or plugin-specific data, you can use the LitExtension app to import your WooCommerce data with custom field mapping options.
Key Takeaway: Which Method Should You Use?
The right method for adding WooCommerce custom fields depends on the information you need and how much technical control you want.
- Built-in custom fields suit small catalogs that only need a few extra details, such as warranty periods or care instructions.
- Plugins suit growing catalogs and personalized-product stores, such as gift shops or print-on-demand brands that need consistent specifications or customer input.
- Custom code suits stores with developers and specialized workflows, such as B2B catalogs with unique data requirements or integrations with internal systems.
For most store owners, a plugin is the most practical starting point. If you already have product data in a CSV file, our Files Migration Service provides an import option, with custom field mapping checked before the transfer.
