---
title: How to Display 2D Barcodes and QR Codes
description: "Show QR codes, Datamatrix or PDF417 for WooCommerce products, encoding the EAN, product URL, SKU or an add-to-cart link. A Pro feature."
url: "https://wpfactory.com/docs/2d-barcode-exploration/"
updated: "2026-09-27"
category: How to
tags:
  - EAN and Barcodes for WooCommerce
---

# How to Display 2D Barcodes and QR Codes

To display QR codes or other 2D barcodes for your WooCommerce products, use [EAN for WooCommerce](https://wpfactory.com/item/ean-barcodes-woocommerce/) Pro. Go to **WPFactory > EAN > 2D Barcodes**, tick **Enable section**, enable the placements you want, and pick a **Barcode type** (QR code, Datamatrix or PDF417). Save changes.

2D barcodes pack more data into a smaller mark than a linear barcode. The **2D Barcodes** section renders QR codes, Datamatrix, or PDF417 from your product EANs, or from other product data such as the product URL. This is a Pro feature.

[![2D barcode options in EAN for WooCommerce](https://wpfactory.com/wp-content/uploads/pasted-image-0-66-1024x464.png)](https://wpfactory.com/wp-content/uploads/pasted-image-0-66.png)

## Before you start

- [EAN for WooCommerce](https://wpfactory.com/item/ean-barcodes-woocommerce/) Pro (2D barcodes are a Pro feature). In the free version, the **Enable section** checkbox is disabled.
- Products need an EAN when the barcode encodes the EAN (the default). For variable products, set the parent product's EAN.

## Enable the section

1. Go to **WPFactory > EAN** (also reachable at **WooCommerce > Settings > EAN**) and open the **2D Barcodes** section.
2. Tick **Enable section** (option `alg_wc_ean_barcode_2d`, default **No**).
3. Tick **Enable** for each placement you need. All are off by default.
4. Under **Advanced Barcodes Options**, choose the **Barcode type**.
5. Click **Save changes**.

## Where 2D barcodes can appear

The placements match the 1D Barcodes section: admin product edit page, admin products list column, single product page, shop pages, cart, admin order edit page, and the order items table on pages and emails. Each placement has its own `..._2d` option, for example `alg_wc_ean_frontend_barcode_2d` for the single product page. The 1D and 2D sections are independent, so you can show both.

**Note:** barcode images in emails do not render on a `localhost` environment.

## 2D barcode type

Under **Advanced Barcodes Options**, the **Barcode type** (option `alg_wc_ean_barcode_2d_barcode_type`, default **QR code: Low error correction**) offers:

- **QR code** with Low, Medium, Better, or Best error correction.
- **Datamatrix** (ISO/IEC 16022).
- **PDF417** (ISO/IEC 15438:2006).

Higher error correction makes a QR code easier to read when printed small or partly damaged, at the cost of a denser pattern. **Suppress errors** (default **Yes**) is recommended.

## Output a 2D barcode with a shortcode

Use `[alg_wc_ean_barcode_2d]` to place a 2D barcode anywhere, or `[alg_wc_ean_barcode_2d_base64]` to get it as a base64 string for custom development. The same shortcode is used in the placement **Template** boxes, for example `[alg_wc_ean_barcode_2d content="ean" w="2" h="2"]` on the product edit page.

### Choose what the code contains

The `content` attribute sets what the 2D barcode encodes:

| content value | Encodes |
| --- | --- |
| `ean` (default) | The product EAN |
| `sku`, `title`, `formatted_name` | The SKU, the product title, or the formatted product name |
| `url` | The product page link |
| `add_to_cart_url` | A link that adds the product to the cart (not for variable parents) |
| `admin_url`, `admin_search` | The product's admin edit page, or an admin products search for it |
| `increase_stock`, `decrease_stock` | A link that changes stock by `stock_qty` (default 1) when opened |

Example: `[alg_wc_ean_barcode_2d content="url"]` prints a QR code customers can scan to open the product page.

**Note:** stock links carry your store's security token and work without logging in, so anyone who scans them changes stock. Keep those codes on internal labels only, never on public pages.

## If the 2D barcode does not appear

- **The section is off.** Placements do nothing until **Enable section** is ticked.
- **The encoded value is empty.** With `content="ean"`, a product without an EAN shows nothing. Stock and cart links are not generated for variable parent products.
- **Your theme skips product meta.** The single product placement hooks into the product meta area. If your template does not output it, add the shortcode to the layout.
- **Missing in emails.** Email barcodes load as an image from your site URL, so they fail on `localhost` and in email clients that block remote images.

## FAQ

### Does a 2D barcode need a valid EAN?

No. Unlike 1D barcodes, 2D codes are not checked against your EAN type. They only need a non-empty value to encode.

### Can I put QR codes on invoices or packing slips?

Yes. Use the **2D Barcodes > Compatibility** section. See [2D barcode compatibility options](https://wpfactory.com/docs/ean-compatibility/).

### Can I print QR code labels?

Yes, with Pro. See [how to use Print Barcodes (PDF)](https://wpfactory.com/docs/woocommerce-barcode-printing/). For linear barcodes, see [how to display product barcodes](https://wpfactory.com/docs/woocommerce-barcode-options/).

### Ready to set this up?

2D barcodes are part of [EAN for WooCommerce](https://wpfactory.com/item/ean-barcodes-woocommerce/) Pro. Upgrading unlocks 1D and 2D barcodes plus PDF label printing. [Get EAN for WooCommerce Pro](https://wpfactory.com/item/ean-barcodes-woocommerce/).

Need a hand? Our team answers every ticket on the [EAN for WooCommerce support forum](https://wpfactory.com/support/item/ean-barcodes-woocommerce/).

Related articles

- [How to Set Up EAN, UPC and GTIN Codes in WooCommerce](https://wpfactory.com/docs/use-ean-upc-gtin/)
- [How to Add Extra Product Code Fields (MPN and More) in WooCommerce](https://wpfactory.com/docs/product-details-optimization/)
- [Show Barcodes in Invoices and Exports (Barcodes Compatibility)](https://wpfactory.com/docs/ean-compatibility-issues/)
- [Barcodes Missing or Extra Text on Printed EAN Labels](https://wpfactory.com/docs/ean-barcode-labels-print-problems/)
- [EAN Barcode Generator: Developer Hooks and Filters Reference](https://wpfactory.com/docs/ean-developer-hooks-filters-reference/)

 

[![EAN, UPC, ISBN Generator: Product Barcode Inventory for WooCommerce](https://wpfactory.com/wp-content/uploads/EAN-for-WooCommerce.webp)](https://wpfactory.com/item/ean-barcodes-woocommerce/)
