To display QR codes or other 2D barcodes for your WooCommerce products, use EAN for 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.
Before you start #
- EAN for 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 #
- Go to WPFactory > EAN (also reachable at WooCommerce > Settings > EAN) and open the 2D Barcodes section.
- Tick Enable section (option
alg_wc_ean_barcode_2d, default No). - Tick Enable for each placement you need. All are off by default.
- Under Advanced Barcodes Options, choose the Barcode type.
- 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
localhostand 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.
Can I print QR code labels? #
Yes, with Pro. See how to use Print Barcodes (PDF). For linear barcodes, see how to display product barcodes.
Ready to set this up? #
2D barcodes are part of EAN for WooCommerce Pro. Upgrading unlocks 1D and 2D barcodes plus PDF label printing. Get EAN for WooCommerce Pro.
Need a hand? Our team answers every ticket on the EAN for WooCommerce support forum.

