On this page, you’ll find a few common reasons why WooCommerce shortcodes may not work as expected.
Shortcodes cannot be embedded between <pre> tags
If your shortcodes are correctly pasted but display incorrectly, ensure they are not enclosed between <pre>
tags.
To remove these tags, edit the page, and click the Text tab:
Incorrect quotation marks
↑ Back to topA common problem is when straight quotation marks ("
) are used instead of curly quotation marks (“
). For shortcodes to function correctly, you must use straight quotation marks.
Variation product SKU not shown
↑ Back to topWhen using an SKU shortcode (such as [products skus="sku-name"]
), do not use the variation name SKU from Product data > Variable product > Variations > Variation name > SKU should not be used.
The solution is to instead use an SKU from the parent variable product‘s Product data meta box — Product data > Variable product > Inventory > SKU.
Code snippets
↑ Back to topNote: We are unable to provide support for customizations under our Support Policy. If you need to customize a snippet or extend its functionality, please seek assistance from a qualified WordPress/WooCommerce developer. We highly recommend Codeable or a Woo Agency Partner.
Top-level Product Categories List
↑ Back to topThe Product Categories List block displays a list of all product categories, both top-level and sub-categories alike. It cannot display only top-level categories.
The snippet below adds a new shortcode — [top_level_product_categories_list]
— which outputs a bulleted list of top-level product categories only. Add it to a child theme’s functions.php
file or via a code snippets extension/plugin.
Questions and support
↑ Back to topDo you still have questions and need assistance?
This documentation is about the free, core WooCommerce plugin, for which support is provided in our community forums on WordPress.org. By searching this forum, you’ll often find that your question has been asked and answered before.
If you haven’t created a WordPress.org account to use the forums, here’s how.
- If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the WooCommerce Marketplace.
- Need ongoing advanced support or a customization built for WooCommerce? Hire a Woo Agency Partner.
- Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.
If you weren’t able to find the information you need, please use the feedback thumbs below to let us know.