White Label Coders  /  Blog  /  What is the API for additional fields in WooCommerce?

Category: WooCommerce

What is the API for additional fields in WooCommerce?

Placeholder blog post
19.04.2025
1 min read

php
// Get a product object
$product = wc_get_product($product_id);

// Method 1: Using WooCommerce’s object-oriented approach
$value = $product->get_meta(‘custom_field_name’);

// Method 2: Using WordPress core functions
$value = get_post_meta($product_id, ‘custom_field_name’, true);

Placeholder blog post
White Label Coders
White Label Coders
delighted programmer with glasses using computer
Let’s talk about your WordPress project!

Do you have an exciting strategic project coming up that you would like to talk about?

wp
woo
php
node
nest
js
angular-2