---
title: Shortcodes for Generating XML Fields
description: "Reference of the shortcodes that generate WooCommerce XML feed fields: dimensions, taxonomies, taxes, shipping and stock."
url: "https://wpfactory.com/docs/shortcodes-for-generating-xml-fields/"
updated: "2026-09-27"
category: Shortcodes
---

# Shortcodes for Generating XML Fields

[Product XML Feeds Manager for WooCommerce](https://wpfactory.com/item/product-xml-feeds-woocommerce/) builds each feed from shortcodes placed inside your XML templates. This reference lists the available shortcodes by topic: dimensions, taxonomies, pricing, images, custom fields and more. Every shortcode is available in the free version, and every one accepts the shared [global attributes](https://wpfactory.com/docs/product-xml-feeds-manager/) (such as `before`, `after`, `on_empty` and `cdata`).

### Dimensions

- **`[alg_product_weight]`**: the product weight.
- **`[alg_product_length]`**: the length. Attributes: `to_unit` (convert units), `round`, `precision`. Example: `[alg_product_length to_unit="cm" round="yes" precision="2"]`.
- **`[alg_product_width]`** and **`[alg_product_height]`**: same attributes as length.
- **`[alg_product_dimensions]`**: length x width x height.

### Taxonomies

- **`[alg_product_tags]`**: product tags. Attributes: `add_links`, `sep`.
- **`[alg_product_categories]`**: linked category list.
- **`[alg_product_categories_names]`**: category names, with a `sep` separator.
- **`[alg_product_categories_urls]`**: category URLs.
- **`[alg_product_categories_ids]`**: category IDs.
- **`[alg_product_terms]`**: terms from any taxonomy. Attributes: `taxonomy`, `sep`, `orderby` (name, parent_id, term_id, hierarchy). Example: `[alg_product_terms taxonomy="product_brand" orderby="name"]`.

### Taxes and shipping

- **`[alg_product_tax_class]`**: the tax class.
- **`[alg_product_shipping_class]`**: the shipping class. Example with a fallback: `[alg_product_shipping_class on_empty="Standard"]`.

### Stock

- **`[alg_product_stock_quantity]`**: the stock quantity.
- **`[alg_product_stock_availability]`**: the availability text. Attributes: `true_label`, `false_label`, `remove_number`. Example: `[alg_product_stock_availability true_label="In stock" false_label="Sold out"]`.

### Price and currency

- **`[alg_shop_currency]`**: the shop currency code.
- **`[alg_product_price]`**: the active price. Attributes include `multiply_by`, `sum_with`, `hide_currency`, `variable_price_type` (range, min, max) and `decimal_padding`. Example: `[alg_product_price multiply_by="1.25"]`.
- **`[alg_product_sale_price]`**, **`[alg_product_regular_price]`**, **`[alg_product_price_including_tax]`**, **`[alg_product_price_excluding_tax]`**: same attributes as `[alg_product_price]`.
- **`[alg_product_you_save]`** and **`[alg_product_you_save_percent]`**: savings amount and percentage. Attributes: `hide_if_zero`, `hide_currency`.

### Title and descriptions

- **`[alg_product_title]`**, **`[alg_product_name]`**, **`[alg_product_formatted_name]`**: product title variants.
- **`[alg_product_excerpt]`** and **`[alg_product_short_description]`**: short description. Attribute: `length`.
- **`[alg_product_description]`**: the full description.

### Images

- **`[alg_product_image_url]`**: main image URL. Attribute: `image_size` (for example `full`, `thumbnail`).
- **`[alg_product_gallery_image_url]`**: a gallery image URL. Attributes: `image_nr`, plus `before`/`after` to wrap the output.

### Custom fields

- **`[alg_product_meta]`**: a product meta value. Attribute: `name` (the meta key). Example: `[alg_product_meta name="_my_field"]`.
- **`[alg_product_custom_field]`**: a custom field value, same `name` attribute.

### Attributes

- **`[alg_product_list_attributes]`**: a list of all attributes.
- **`[alg_product_list_attribute]`**: a single attribute. Attribute: `name`. Example: `[alg_product_list_attribute name="size"]`.

### Formatting

- **`[alg_format_date]`**: formats the wrapped value as a date. Attribute: `format`. Example: `[alg_format_date format="m-d-Y"][alg_product_meta name="_my_date"][/alg_format_date]`.
- **`[alg_format_number]`**: formats the wrapped value as a number. Attributes: `decimals`, `dec_point`, `thousands_sep`.
- **`[alg_to_timestamp]`**: converts the wrapped date string to a timestamp.

### Variations

- **`[alg_product_available_variations]`**: available variations. Attributes: `sep`, `sep2`, `sep3`.

### General

- **`[alg_current_datetime]`**: the current date and time. Attribute: `datetime_format`.
- **`[alg_product_id]`**, **`[alg_product_type]`**, **`[alg_product_url]`**, **`[alg_product_sku]`**: product identifiers.
- **`[alg_product_total_sales]`**: total sales. Attributes: `hide_if_zero`, `offset`.
- **`[alg_product_average_rating]`**: the average rating.
- **`[alg_product_time_since_last_sale]`**: time since the last sale. Attributes: `order_status` (default `wc-completed`), `days_to_cover` (default 90).
- **`[alg_product_function]`**: the result of an allow-listed `WC_Product` method. Attribute: `function`. Example: `[alg_product_function function="get_description"]`. See the [Developer hooks and filters reference](https://wpfactory.com/docs/product-xml-feeds-manager/) for the allow-list.

### Need a hand?

All of these shortcodes are free. Our team answers every ticket on the [Product XML Feeds support forum](https://wpfactory.com/support/item/product-xml-feeds-woocommerce/).

Related articles

- [Shortcodes Guide for Product XML Feeds](https://wpfactory.com/docs/woocommerce-xml-feeds/)
- [How to Add WooCommerce Brands to a Product XML Feed](https://wpfactory.com/docs/xml-feed-woocommerce-brands/)
- [Global Shortcode Attributes Reference](https://wpfactory.com/docs/global-shortcode-attributes-reference/)
- [Product XML Feeds: Developer Hooks and Filters Reference](https://wpfactory.com/docs/product-xml-feeds-developer-hooks-filters/)
- [Create Multiple XML Feeds](https://wpfactory.com/docs/create-multiple-xml-feeds/)
