Blog

WooCommerce Custom Product Fields: How to Add Both Kinds

WooCommerce custom product fields: spec rows the store fills in and an engraving field with a price that the customer fills in

WooCommerce custom product fields come in 2 kinds. Either it’s a field you fill in for each product, such as care instructions, the maker or a material, or it’s a field your customer fills in before adding the product to the cart, such as a name to engrave, a photo to print or a size with its own price. The 2 need completely different tools, and most guides mix them up.

The short answer: for fields you fill in, WooCommerce already has what you need. A custom attribute with “Visible on the product page” ticked shows as a row on the product page, with no code. For fields your customer fills in, WooCommerce has nothing built in, so you need code on 5 WooCommerce hooks or a plugin.

We tested 5 ways in a test store (WooCommerce 11.2.1, our Larch Home demo shop): an attribute, WooCommerce’s Custom Fields panel, a short snippet, a specifications tab, and a plugin that adds a paid engraving field. This guide shows what each one does on the product page, in the cart and on the order, so you can choose the right one in a few minutes.

The 2 kinds of WooCommerce custom product fields

Ask one question first: who types the value?

  • You do, once per product. Specs, care instructions, the studio that made it, a warranty length, dimensions in a format WooCommerce doesn’t have. Every shopper sees the same value. You need a place to store it and a place to show it.
  • The customer does, on every order. Engraving text, a gift message, a file upload, a delivery date, a choice like “Gift wrap +$5”. Each order gets a different answer, often with a price. You need a form field on the product page, a check that it’s filled in, and the answer carried into the cart, the order and the emails.

The table below sums up what each tool does, based on our tests.

Comparison of WooCommerce custom product fields: attributes, the Custom Fields panel and a product options plugin, by who sets the value, display, filtering, price and order

Fields you fill in: how to add custom fields to a WooCommerce product

There are 3 ways to add information to a product. Only the first one shows on the product page without code or another plugin.

Option 1: a custom attribute (no code)

Attributes are usually explained as the thing behind variations (Size, Color), but an attribute doesn’t have to make variations. It can hold any label and text, and WooCommerce prints it in the product’s Additional information tab. Here is how we added a “Care” line to the Ribbed Vase, Tall:

  1. Open the product in Products > All Products and go to Product data > Attributes.
  2. Click Add new. In Name type the label (“Care”); in Value(s) type the text (“Hand wash only. Not frost-proof.”).
  3. Keep Visible on the product page ticked. On a variable product, leave Used for variations unticked.
  4. Click Save attributes, then Update.

One catch: WooCommerce reads a “|” in Value(s) as a separator. We saved “Hand wash only | Not frost-proof” and the product page showed “Hand wash only, Not frost-proof”, as 2 values joined by a comma. Use periods or commas in care text, not pipes.

Custom attribute Care with the value Hand wash only and Visible on the product page ticked in the WooCommerce Attributes panel

On the product page, the attribute appears as its own row under Weight and Dimensions:

Care and Studio rows in the Additional information tab of a WooCommerce product page

A custom attribute only exists on that one product. If the same field goes on many products (“Material” on every vase), create a global attribute in Products > Attributes instead and pick it with Add global. As WooCommerce’s attribute docs put it, “Attributes created on the product page are not available for global use”. Global attributes can also be used by shop filters, so shoppers can narrow the shop to “Stoneware”. Custom ones can’t.

The limits: values are plain text, the rows only appear in the Additional information table, and you type the value product by product.

Option 2: the Custom Fields panel (stores data, shows nothing)

WooCommerce products support WordPress custom fields, which is what many guides point to. The box is hidden by default. To show it, open a product, click Screen Options at the top right and tick Custom Fields. The panel then appears under Product data, where you add a name and a value.

WooCommerce product Custom Fields panel with care_instructions, studio and total_sales
Our 2 fields, plus total_sales: WooCommerce’s own sales counter. Don’t edit or delete it.

We saved care_instructions and studio on the vase, then searched the product page’s HTML for both values: 0 matches. Custom fields are stored, not displayed. WooCommerce’s own doc says the same: to show them, “you have to edit your theme’s files”.

Two more things to know. The panel lists some of WooCommerce’s own data too, like total_sales in the screenshot, so be careful what you change there. Fields whose name starts with an underscore (WooCommerce’s _price, _sku and so on) are hidden from the panel. Use the Custom Fields panel when something else reads the value: your theme, a product feed, or the snippet below.

Developers often go one step further and add a proper input to Product data > General with the woocommerce_product_options_general_product_data hook (and save it with woocommerce_process_product_meta), or build the field with Advanced Custom Fields. That gives a tidier edit screen, but the value is stored the same way: it still needs code, or a plugin’s display option, to appear on the product page.

Show a custom field on the product page with a snippet

If you already have values in custom fields (from an import, say) and want them on the product page, this snippet adds a “Care” row to the Additional information table from the care_instructions field. Paste it in a code snippets plugin or your child theme’s functions.php, and change the field name and label to yours:

// Show the "care_instructions" custom field in the Additional information tab.
add_filter( 'woocommerce_display_product_attributes', function ( $rows, $product ) {
	$care = $product->get_meta( 'care_instructions' );
	if ( $care ) {
		$rows['care_instructions'] = array(
			'label' => 'Care',
			'value' => esc_html( $care ),
		);
	}
	return $rows;
}, 10, 2 );

It worked on the vase. Then we tried it on a glass bottle with no weight, no dimensions and no attributes, and nothing showed. WooCommerce only adds the Additional information tab when a product has a weight, dimensions or a visible attribute, so on a product with none of those there is no table to add the row to. If many of your products have none of them, use an attribute or a specifications tab instead.

Option 3: a specifications tab for many products

Attributes and custom fields are typed product by product. When the same specs or care text belong on a whole category, a shared tab is less work. Custom Product Tabs & FAQ has a Specifications kind of tab: a table of labels and values that looks like WooCommerce’s Additional information table. You write it once in Products > Tabs > Add tab, choose Specifications, and show it on all products, chosen categories or tags, or chosen products (setup steps in the docs). In the test store, one Specifications tab set to Products in categories: Furniture shows on every chair:

Specifications tab with material, seat height, weight capacity, assembly and origin on a WooCommerce product page

Change a row once and every product in the category shows the new text. Each product also gets its own Tabs panel for one-off specs, such as a size guide.

Fields your customer fills in: add a custom field to the WooCommerce product page

This is the meaning behind “engraving field”, “gift message” or “upload your photo”. WooCommerce’s only built-in way to let a customer choose something is variations, and they’re limited to picking one of your preset values (Size: Large), each with its own price and stock. A variation can’t take free text or a file, can’t add $5 on top of the price, and can’t appear only when another box is ticked.

What a hand-coded customer field needs

We checked what one plain text field needs in WooCommerce 11.2.1’s code. These are the 5 hooks a developer has to cover:

  1. Show the field above the Add to cart button (woocommerce_before_add_to_cart_button).
  2. Check it when it’s required, or the product goes into the cart without the answer (woocommerce_add_to_cart_validation).
  3. Keep the answer with the cart item, so 2 vases with 2 names become 2 cart lines (woocommerce_add_cart_item_data).
  4. Show it in the cart and checkout (woocommerce_get_item_data). The Cart and Checkout blocks read this one too.
  5. Save it on the order, so it’s in the admin and the emails (woocommerce_checkout_create_order_line_item). Block checkout calls this one as well.

A price for the field needs a sixth piece that changes the cart price, and a file upload needs safe storage on top. For one free text field without a price, that’s a small job for a developer. For anything with prices, choices, conditions or uploads, a plugin is the practical answer.

With a plugin: paid fields and conditions

Product Options & Add-ons adds fields customers fill in on the product page: text, checkboxes, buttons, dropdowns, swatches, dates, file uploads and more. Each field can have a price, and can show only when another field is filled in.

Product Options & Add-ons in 20 seconds.

In the test store, every ceramic product offers a glaze finish and an optional hand-carved inscription at $0.75 a letter. This is how that set is built (the plugin docs cover every field type):

  1. Go to WooCommerce > Settings > Product options and click Add option set (or start from one of the examples, such as gift wrapping).
  2. Give the set a name for your reference and, under Products, choose Products in categories and Ceramics. A set can also cover all products, tags, brands or single products.
  3. Click Add field and choose Buttons for “Glaze finish”, with 3 choices: Matte, Satin +$4, High gloss +$6. Tick Required.
  4. Add a Checkbox field: “Add a hand-carved inscription”.
  5. Add a Short text field, “Inscription”, with Price 0.75, Price is “Per character, on each item” and Most characters 20. Tick Required, and under Show this field when pick the inscription checkbox and “is filled in or ticked”.
  6. Click Save changes.
Inscription field priced at $0.75 per character with a 20 character limit, shown only when Add a hand-carved inscription is ticked
The price, the price type, the character limit and the condition of the Inscription field.

On the product page, the Inscription field stays hidden until the customer ticks the checkbox. A summary under the fields and the Add to cart button update as they type. We chose Satin and typed “For Maya & Sam” on the $46 vase:

WooCommerce product page with a custom engraving field filled in and a live total of $58.25 on the Add to cart button

The total is $46 + $4 for Satin + $8.25 for the inscription = $58.25. Why $8.25 and not $10.50 for 14 characters? Per-character prices skip spaces, so “For Maya & Sam” counts 11 characters. The 20-character limit does count spaces, because they take room on the vase. Worth knowing before you set your price per letter.

We then placed the order through the Cart and Checkout blocks. The answers stay with the item everywhere: under the product in the cart, in the checkout summary, in the order emails and on the order screen, where your team reads what to engrave.

WooCommerce order item showing Glaze finish Satin, the inscription checkbox and the engraving text For Maya and Sam with their prices

A second vase with a different name went into the cart as its own line, as it should. Customers can also open an item from the cart to change their answers, and “Order again” brings the same options back.

When the fields don’t need a price

If you only need to collect information (a gift message, a delivery date, a logo to print) and nothing changes the price, Product Input Fields is the simpler tool for those custom product fields. It has text, date, file upload and choice fields, required fields with character limits, and conditions, with the answers kept on the order. Its fields never change prices; that’s the job of Product Options & Add-ons.

FAQ

What is the difference between custom fields and attributes in WooCommerce?

Both hold information you type for a product. An attribute set to “Visible on the product page” shows in the Additional information tab without code, any attribute can make variations, and global ones can also filter the shop. A custom field is only stored: it shows nowhere until a theme, a snippet or a plugin prints it.

Why is my custom field not showing on the product page?

Because WooCommerce never displays values from the Custom Fields panel. You need code that prints them, such as the snippet above. If you use that snippet and the row still doesn’t appear, check that the product has a weight, dimensions or a visible attribute; without one, WooCommerce doesn’t show the Additional information tab at all.

Can I add custom fields to WooCommerce without a plugin?

For information you fill in, yes: use a custom or global attribute. For fields customers fill in, not without code. WooCommerce only lets customers pick variations, so free text, uploads and paid extras need either the 5 hooks described above or a plugin.

Can a custom field change the product price?

Attributes and custom fields can’t. Variations can, but only as a fixed price per variation. To add a price for a choice (gift wrap +$5), per letter (engraving) or by a formula (width × height), you need a product options plugin such as Product Options & Add-ons.

Can a field show only for one variation?

Yes, with Product Options & Add-ons: a field’s condition can be a variation the customer picks, such as showing an “Inscription” field only for Size: Large. Product Input Fields works with simple and variable products too, with conditions based on its own fields.

Which kind should you add?

Start with who fills the field in. If it’s you, add a custom attribute today: it takes a minute and shows on the product page without code. Move to a global attribute when the field repeats across products, and to a shared specifications tab when whole categories share the same text. If it’s your customer, decide whether the answer changes the price. If not, a plain input field does the job. If it does, or you need choices, uploads and conditions, try Product Options & Add-ons on the live demo first, with a 14-day money-back guarantee if it isn’t the right fit.

14-day money-back guarantee

Try it on your store, risk-free

Every plugin includes ongoing updates and support. If it isn’t right for your store, get a full refund within 14 days, no questions asked.