Using GTIN numbers on products in WooCommerce

By default WooCommerce adds in a SKU custom field to products, but that may not cover your needs, depending on the products you offer. If you’re selling books or magazines ISBN numbers are going to be necessary. Various GTIN (Global Trade Identification Number) options are also important, both for selling and for tracking your products.

How to add GTIN number fields to WooCommerce Products

Or: I need to be able to add GTIN numbers onto the products listed on my store, but WooCommerce only adds an option for SKU?

Fortunately, there is code that can be added to your theme’s function.php that will allow you to use different GTIN options, be they UPC, EAN or ISBN numbers, for the products you’re selling. This is also handy if you happen to be listing your products on Amazon, via a feed.

WordPress Code Warning:
This article features code changes, or snippets, that you can make in your active themes function.php file. If you are unfamiliar with this task, or want to brush up, we have an article on Managing code snippets in WooCommerce. The technique provided can be used for both WordPress and WooCommerce sites.

It is recommended that you try this in a staging environment, which allows you the ability to make sure you have the functionality you’re looking for, without impacting your live site until you’re ready.

Alternative Option: Use a plugin to add GTINs

The option above is great if you’re familiar with customizing your site with code. You can easily drop that code into your themes functions.php file or even as a mu-plugin and get rolling. For those less familiar with using code though an alternative exists. There is a plugin on WordPress.org that can add the field in for you called WooCommerce Add GTIN: UPC, EAN, and ISBN. Just install this plugin like any other one and you’ll be good to go.

Be Sociable, Share!

    Author Bio

    About the Author: Dan Pock

    Dan Pock does Technical Writing & Marketing at Liquid Web with a background in System Administration, Public Relations, and Customer Service.

    His favorite things include: his cats, Oscar Boots and Dash Nouget; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

    Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support