Image

Shortcodes included with WooCommerce

Note:

WooCommerce blocks are the simplest, most flexible way to display products on posts and pages. Learn more about WooCommerce blocks.

WooCommerce has traditionally utilized shortcodes to add dynamic content and features to WordPress pages. With WordPress’s evolution toward the Gutenberg block-based editor, the focus has shifted from shortcodes to more interactive and visually integrated blocks.

While the block editor offers interactively customizable blocks and enhanced editing capabilities, we recognize many stores still lean heavily on shortcodes. You can use legacy shortcodes inside a shortcode block.

How to use shortcodes

Where to use shortcodes

Shortcodes can be used on WordPress posts and pages. If you are using the block editor, you can paste the shortcode into a shortcode block.

You can insert a shortcode in the block editor via the shortcode block.

If you are using the Classic Editor, you can paste the shortcode directly into the page or post content. 

Shortcode attributes

Some shortcodes allow you to modify them to make them more specific or display content in a certain way. You can modify shortcodes by adding attributes (AKA arguments or args) to them.

For example, adding the attribute id to the [add_to_cart] shortcode will create an add-to-cart button for a specific product. [add_to_cart id=”99”] displays an add-to-cart button for the product with an ID of 99 in your shop.

WooCommerce shortcodes

The table below provides an overview of the shortcodes available in WooCommerce. Each item includes a brief description and a link to shortcode-specific documentation.

As WooCommerce has moved to block-based store editing, we’ve also included links to block alternatives for each shortcode (where applicable).

ShortcodeDescriptionLearn moreBlock alternative
[woocommerce_cart]Displays the cart page.Cart shortcodeCart block
[woocommerce_checkout]Displays the checkout page.Checkout shortcodeCheckout block
[woocommerce_my_account]Displays the user account page.My account shortcodeNone yet
[woocommerce_order_tracking]Displays the order tracking form; has attributes.Order tracking shortcodeNone
[product_page]Displays a full single product page by ID or SKU.Product page shortcodeCustom product page templates can be made using the store editor
[products]Displays products by specific parameters; has attributes.Product shortcodesProduct collection block (and others*)
[product_category]Displays products in a specified category; has attributes.Product category shortcodesProduct collection block
[product_categories]Displays product categories; has attributes.Product category shortcodesNone yet
[add_to_cart]Displays an add-to-cart button for a product; has attributes.Add-to-cart shortcodeAvailable on single product page templates
[add_to_cart_url]Gets the URL of an add-to-cart button for a product; has attributes.Add-to-cart URL shortcodeNone
[shop_messages]Displays shop messages on non-WooCommerce posts or pages.Shop message shortcodeStore notices block

Note;

A variety of blocks display products with different options, including the all products block, hand-picked products block, products by category block, products by tag block, and more.

These are being deprecated in favor of the more robust and versatile product collection block.

Releated Posts

LMS Video

LMS Student Login LMS Subject Add Full Video

ByByITX AdminApr 6, 2025

Certificate System Administrator

certificate system administrator

ByByITX AdminApr 6, 2025

Tracking System Setup

tracking system setup Video

ByByITX AdminApr 6, 2025
1 Comments Text
  • grege says:
    Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.
    e
  • Leave a Reply

    Your email address will not be published. Required fields are marked *