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

Isometric illustration of an AI voice agent: a smartphone with a sound wave linked to a headset robot receptionist, a booking calendar and stacks of coins

AI Voice Agent Cost in 2026: Platforms vs a Custom Build

A missed call at a clinic, salon or service business is often a missed booking. That is why owners now…

Shafeeq Khan
October 22, 2026
Isometric illustration of an AI answer panel citing a business website, with an AI crawler and search pages connected to it, for an AEO services guide

AEO Services: Get Cited in ChatGPT and Google AI Overviews

When a buyer asks ChatGPT, Perplexity, Gemini or Google’s AI Overviews “who builds X in India?” or “what does Y…

Shafeeq Khan
October 19, 2026
Isometric illustration of an old AI model chip being swapped for a new one in a server that powers web and mobile apps, for a GPT-4o API migration guide

GPT-4o API Shutdown: Migrate Your App Before 14 January 2027

If your chatbot, document pipeline or internal tool still calls GPT-4o or GPT-4.1, it has a deadline. On 14 October…

Shafeeq Khan
October 19, 2026
,

Leave a Reply

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