How to Add a GTIN (UPC, EAN) field to WooCommerce

Most retailers use a GTIN (Global Trade Item Number) to track and identify their products, but WooCommerce does not have this field by default.

In this post I’ll show you how to add it.

What is a GTIN?

A GTIN is a unique, internationally recognized product tracking number.

In North America, a UPC code is used, while in Europe it’s called an EAN. You may also have heard of an ISBN, which is used for books.

GTINs are used for internal tracking, and are required in product feeds for Google and Amazon.

How to add a UPC/EAN/ISBN field to WooCommerce

WooCommerce UPC field

By default, WooCommerce comes with a field for SKU, but not GTIN. To add the GTIN field for your UPC, EAN, or ISBN number, we can either use a plugin or custom code.

Here are some things to consider about your GTIN:

  • GTIN field is optional, and can be shown or hidden on product pages.
  • Variable products must allow for separate GTINs for each variation
  • GTIN can be used for Google and Amazon product feeds

Doing this with custom code is a bit complicated, so I built a plugin to do this all for you.

It’s called WooCommerce Add GTIN and you can get it by going to plugins => add new, or download it directly.

This plugin adds a GTIN field to each product under Inventory. It also adds a unique GTIN field for each product variation.

The GTIN is displayed on the product page with the other product meta. To hide the GTIN on the product page, visit WooCommerce settings => Products => Inventory => “Hide GTIN on single product pages.”

Add GTIN to your Google Products Feed

To create a Google Shopping feed, you can use a plugin like Product Feed Pro.

Create a new feed, choose your feed type, and map the HWP GTIN field to your feed mpn or gtin field.

If you have any questions leave them in the comments.

Ready to get more leads and sales?

Use Hollerbox to design and deploy popups faster.

25 thoughts on “How to Add a GTIN (UPC, EAN) field to WooCommerce”

    1. Hi, the main GTIN is in post meta under hwp_product_gtin:

      get_post_meta( $post_id, 'hwp_product_gtin', 1 );

      If you have variations with GTINs, you can find those in post meta like this:

      get_post_meta( $variation['variation_id'], 'hwp_var_gtin', 1 );

      You have to loop through the variations to get that.

  1. Hello.
    Will this field be searchable in woocommerce backend ? I mean in example on the orders list page or products list page or either when adding a product to a new order (backend) this would be great to use the backend as a casher with a barcode reader.

  2. Hi Scott,

    This looks like a great plugin! Thank you for making it available!

    A question please, if I may?

    I’m trying to setup a Google shopping feed and Google is requiring Brand and GTIN. I am using a plugin that I downloaded to build this feed. It’s allowing me to map my fields to the required shopping feed by having me choose from a drop down list. Will the GTIN from your plugin show in the dropdown list?

    Thanks!!

  3. Hi scott

    Thanks for this great plug in, its added exactly what i needed to my woocommerce store. Only problem i have is that we have installed a POS plug in for the shop as a physical shop is opening in a few weeks. The plug in im using is woocommerce POS by actualityextensions. The plug in allows you to use a scanner to scan EAN products, only problem is in the POS plug in you need to select which fields to search when scanned. Iv looked for hwp_product_gtin, and hwp_var_gtin, but neither show up in the list of searchable fields. Any way i can make the EANs searchable.

    Thanks

  4. Hi Scott

    Great plugin and it worked perfectly on my single store, but when i try it in multistore the “field” wont show. You experienced any thing like it?

    Best Regards Lasse

  5. I’m using the ‘WooCommerce Customer/Order CSV Export’ plugin, which allows me to assing and add a meta field to my exported CSV reports.

    I’ve assumed the field I need to add to my export report is ‘hwp_product_gtin’, so I’ve added this field, however nothing is showing up in my exported report.

    Is anyone able to share any code – or guidance – to assist me in achieving this (I’m assuming something needs to be set up in funtions.php to register the field) ?

    I’m out of my depth with this sort of thing so I’d be most grateful for any assistance.

    Cheers, Joel

  6. Hi

    I have added the plugin , able to add gtin but in google webmaster , still validation is failing . it looks gtin is not getting added in schema

    Please suggest solution

    Thanks

Leave a Comment

Scroll to Top