Magic of WooCommerce Products Custom Fields

Web Design

WooCommerce is without any doubt the more powerful e-commerce plugin for WordPress. And what i love with WooCommerce is that there’s an API for nearly everything. Today, i decided to show you how you can customize WooCommerce dynamically, and in particular how to add custom fields to any WooCommerce products. Here is the final result of what you’ll learn to do in this post:

Magic of WooCommerce Products Custom Fields – screenshot 1

As you can on the screenshot above we will see how to add custom fields to the product edition page. To do that we will be working on the functions.php file of your theme’s folder only.
To begin we will add custom fields to the product general tab, we will see later how to add custom fields to the other tabs, and how to create your own tabs.

The right hooks
The first step is to hook an action to woocommerce_product_options_general_product_data. The function linked to this hook will be responsible of the new fields display. A second hook will be taken into account to save fields values: woocommerce_process_product_meta. Basically these two actions will be done using that code:

// Display Fields
add_action( ‘woocommerce_product_options_general_product_data’, ‘woo_add_custom_general_fields’ );
// Save Fields
add_action( ‘woocommerce_process_product_meta’, ‘woo_add_custom_general_fields_save’ );

Adding New Fields

The snippet above link two custom functions to the right hooks. Now we need to create those functions. Let’s start bye the first one, woo_add_custom_general_fields(), that will create the fields. Here is how the function will look like

Related reading:

Shiv Kumawat

Executive Director & CEO

Shiv Kumawat is the CEO of Eoxys IT Solution LLP, the Jaipur-based IT company he has led since 2009. An AI & IT Solutions Consultant with 16+ years of experience, he works with startups and enterprises to turn ideas into market-ready SaaS platforms, mobile apps and AI-driven solutions. His team has delivered 700+ projects across SaaS, mobile and web apps, automation and AI. He previously served as Chief Technology Officer for a US company.

Latest Posts

Food delivery app development cost in the UK: delivery rider with an insulated bag and a takeaway order at a townhouse door

Food Delivery App Development Cost in the UK (2026)

A food delivery order in the UK succeeds or fails in about forty minutes: the kitchen has to accept it…

Shafeeq Khan
December 1, 2026
Colour photograph illustrating the Eoxys blog post 'Year-End AEO Checklist: Get Ready for AI Search in 2027', used as the featured image for year end aeo checklist.

Year-End AEO Checklist: Get Ready for AI Search in 2027

December is a good time to check whether your website is ready for how people search in 2027. AI answers…

Shafeeq Khan
December 1, 2026
Logistics app development cost in Canada: smiling delivery driver in a red uniform at the wheel of a white van

Logistics App Development Cost in Canada (2026)

A courier app in Canada earns its keep in the moments nobody demos: the driver who loses signal in a…

Shafeeq Khan
November 30, 2026
,

Leave a Reply

Your email address will not be published. Required fields are marked *