---
title: EAN Template Placeholders and Shortcodes Reference
description: Reference for EAN for WooCommerce template placeholders and shortcodes, free and Pro, to control where EANs appear.
url: "https://wpfactory.com/docs/ean-placeholders-shortcodes-reference/"
updated: "2026-09-27"
category: References
---

# EAN Template Placeholders and Shortcodes Reference

This reference lists the template placeholders and shortcodes provided by [EAN for WooCommerce](https://wpfactory.com/item/ean-barcodes-woocommerce/), so you can control exactly where and how each product's EAN appears. Placeholders are used inside the plugin's own template fields; shortcodes work anywhere WordPress runs shortcodes.

### Template placeholders

Placeholders are replaced with live values in the plugin's template boxes, such as **General > Single product page > Template**, the shop, cart, and order item table templates.

| Placeholder | Replaced with | Where it works |
| --- | --- | --- |
| `%ean%` | The product's EAN value. | Single product, shop, cart, and order item table templates. |
| `%new_line%` | A line break. | Plain text order item table template (emails only). |

The default single product template is `EAN: %ean%`. You can also place shortcodes inside these template fields.

### Core shortcodes (free)

The main shortcode outputs the EAN. Attributes shown are the most common; all shortcodes share `product_id`, `before`, `after`, and `on_empty`.

| Shortcode | Outputs | Notable attributes |
| --- | --- | --- |
| `[alg_wc_ean]` | The product's EAN. | `children="yes"`, `glue` |
| `[alg_wc_ean_is_valid]` | Whether a given EAN is valid. | `ean`, `valid_text`, `invalid_text` |
| `[alg_wc_ean_is_unique]` | Whether a given EAN is unique in the shop. | `ean`, `unique_text`, `duplicate_text` |
| `[alg_wc_ean_product_sku]` | The product SKU. | `parent`, `max_length` |
| `[alg_wc_ean_product_name]` | The product name or title. | `type` (name or title) |
| `[alg_wc_ean_product_price]` | The product price. | `type` (final, regular, sale), `raw` |
| `[alg_wc_ean_product_attr]` | A product attribute value. | `attr` |
| `[alg_wc_ean_product_meta]` | A product meta value. | `key` |
| `[alg_wc_ean_product_image]` | The product image, as an `img` tag or URL. | `output`, `size`, `width`, `height` |
| `[alg_wc_ean_product_id]`, `[alg_wc_ean_product_author_id]` | The product ID or its author ID. | `parent`, `min_length` |
| `[alg_wc_ean_product_terms]` | Product terms (categories, tags, or any taxonomy). | `taxonomy`, `return` |
| `[alg_wc_ean_if]`, `[alg_wc_ean_if_product_cat]`, `[alg_wc_ean_if_product_tag]` | Conditional output based on a comparison or category/tag. | `value1`, `operator`, `value2`, `then`, `else` |

### Barcode shortcodes (Pro)

Barcode output is a Pro feature. The **Barcodes** or **2D Barcodes** section does not need to be enabled for the shortcodes themselves to render.

| Shortcode | Outputs | Notable attributes |
| --- | --- | --- |
| `[alg_wc_ean_barcode]` | A 1D barcode image. | `content`, `w`, `h`, `color`, `add_text`, `template` |
| `[alg_wc_ean_barcode_2d]` | A 2D (QR-style) barcode image. | `content`, `w`, `h`, `color` |
| `[alg_wc_ean_barcode_base64]`, `[alg_wc_ean_barcode_2d_base64]` | The barcode as a base64 data string, for PDFs and exports. | `w`, `h`, `color`, `before` |

### Related

- [Shortcode guide to EAN and barcodes](https://wpfactory.com/docs/ean-barcodes-woocommerce/) for worked examples.
- [Developer hooks and filters reference](https://wpfactory.com/docs/ean-barcodes-woocommerce/) for filter names.

### 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

- [EAN Barcode Generator: Developer Hooks and Filters Reference](https://wpfactory.com/docs/ean-developer-hooks-filters-reference/)
- [Shortcode guide to EAN and Barcode](https://wpfactory.com/docs/woocommerce-ean-barcode-guide/)
- [Barcodes Missing or Extra Text on Printed EAN Labels](https://wpfactory.com/docs/ean-barcode-labels-print-problems/)
- [How to Reset EAN Settings (Section or Whole Plugin)](https://wpfactory.com/docs/reset-ean-settings-section/)
- [Import and Export Product EANs with the WooCommerce CSV Tools](https://wpfactory.com/docs/import-export-product-eans/)
