How to Use the WooCommerce Featured Products Shortcode to Highlight Key Items?

Learn how to effectively use the WooCommerce featured products shortcode to showcase your best products, customize layouts, and drive sales. This guide covers attributes, examples, and troubleshooting tips to optimize your store's product visibility.
Contents
how to use WooCommerce featured products shortcode?
Learn how to effectively use the WooCommerce featured products shortcode to showcase your best products, customize layouts, and drive sales. This guide covers attributes, examples, and troubleshooting tips to optimize your store's product visibility.
Contents

The WooCommerce featured products shortcode ([featu​red_products]) is one of the WooCommerce shortcodes that allows you to easily display products you want to highlight in your store, such as bestsellers, seasonal items, or promotions.

It focuses exclusively on featured products—those marked as “featured” in your WooCommerce settings. This feature is ideal for increasing visibility and driving sales for selected items.

To mark a product as featured, navigate to your WordPress dashboard > Products > All Products, and click the star icon in the “Featured” column.

How to use WooCommerce featured products shortcode?
How to use WooCommerce featured products shortcode?

It’s worth noting that while [featu​red_products] is a reliable shortcode, WooCommerce has introduced the more versatile [prod​ucts] shortcode in newest updates. With WooCommerce products shortcode, you can showcase various product types, such as featured, on-sale, or top-rated products, using a single unified syntax

For example, [prod​ucts visibility="featured"] achieves the same result as [featu​red_products] but offers greater flexibility for customization.

In this article, the focus is on understanding the [featu​red_products] shortcode and how to utilize it effectively.

Complete List of Attributes for WooCommerce Featured Products Shortcode

The [featur​ed_products] shortcode in WooCommerce is simple yet customizable. Its attributes let you control how WooCommerce featured products are displayed, making it easy to tailor the layout and functionality to your store’s needs.

Below is a breakdown of the key attributes available for the WooCommerce featured products shortcode and how they can enhance your product presentation.

AttributeDescription
limitDefines the number of products to display. Default is 4.
columnsSets the number of columns in the product grid. Default is 4.
orderbyDetermines the order of products. Options include title, price, date, or rand.
orderSpecifies the order of sorting: ASC (ascending) or DESC (descending).
categoryFilters featured products to display only from specific categories.
cat_operatorSets the logic for category filtering: AND, OR, or NOT IN.
classAdds a custom CSS class for styling the output.
Source:WooCommerce Documentation

limit=””

The limit attribute controls how many featured products appear. By default, WooCommerce displays four products, but you can adjust this to suit your needs. For example:

PHP
[featured_products limit="6"] //Displays six featured products.
Example of using limit attribute in WooCommerce featured products shortcode
Example of using limit attribute in WooCommerce featured products shortcode

columns=””

With the columns attribute, you can control the number of columns in your product grid. This is especially useful for designing responsive layouts. For example:

PHP
[featured_products columns="3"] //Displays products in three columns.
Example of using columns attribute in WooCommerce featured product shortcode
Example of using columns attribute in WooCommerce featured product shortcode

orderby=””

The orderby attribute determines how the featured products are sorted. Popular options include:

  • title (alphabetical order).
  • price (ascending or descending price).
  • date (newest to oldest or vice versa).
  • rand (random order).

For example:

PHP
[featured_products orderby="price"] //Sorts products by price.

order=””

Pair the order attribute with orderby to control the direction of sorting. Use “ASC” for ascending order or “DESC” for descending. For example:

PHP
[featured_products orderby="date" order="DESC"] //Displays the newest products first.

category=””

The category attribute allows you to show featured products from specific categories. This is great for creating tailored sections, such as “Featured Electronics” or “Seasonal Deals”. For example:

PHP
[featured_products category="electronics"] //Displays featured products from the "electronics" category.

cat_operator=””

Use the cat_operator attribute to define how categories are combined:

  • AND: Products must belong to all specified categories.
  • OR: Products can belong to any of the specified categories.
  • NOT IN: Excludes products from specified categories.

For example:

PHP
[featured_products category="sale,clothing" cat_operator="AND"] //Displays featured products that are in both "sale" and "clothing" categories.

class=””

The class attribute enables you to add custom CSS classes for styling the shortcode output. This makes it easy to match the display to your store’s design. For example:

PHP
[featured_products class="custom-featured-grid"] //Applies the "custom-featured-grid" CSS class for custom styling.

By understanding and utilizing these attributes, you can fully customize the [featur​ed_products] shortcode to create tailored and visually appealing product displays.

Whether you want to highlight products from specific categories, customize the grid layout, or apply unique styling, these options make the shortcode versatile and functional for any WooCommerce store.

Step-by-Step Guide: Adding the WooCommerce Featured Products Shortcode to Your Website

The WooCommerce featured products shortcode is incredibly versatile and can be added to your site in multiple ways. Whether you’re creating a custom page, enhancing a sidebar, or modifying a template, here’s a simple step-by-step guide to get you started.

Adding the Shortcode to Pages or Posts (Block Editor – Gutenberg)

The block editor in WordPress makes it easy to add the shortcode to any page or post.

  1. Go to your WordPress dashboard and navigate to Pages or Posts.
  2. Open the page or post where you want to display your featured products.
  3. Add a new block by clicking the “+” icon.
  4. Search for the Shortcode block and select it.
  5. Enter your shortcode.
  6. Save or publish the page, and your featured products will appear in the specified layout.
How to use WooCommerce shortcodes | WooCommerce shortcodes | WooPlugins
How to use WooCommerce shortcodes in WordPress?

3. Adding to Custom Templates

For more advanced customization, you can include the shortcode directly in your theme’s template files.

  1. Open your theme’s files using a code editor.
  2. Locate the template where you want to add the featured products section (e.g., front-page.php or home.php).
  3. Use the do_shortc​ode() function to embed the shortcode:
  4. Save the changes, and your featured products will display within the custom template.

do_sho​rtcode() example:

PHP
echo do_shortcode('
');

Pro Tip: Optimize Placement for Conversions

When using the shortcode for featured products in WooCommerce, placement matters. Add featured products near the top of your homepage or on high-traffic pages to maximize visibility and drive more clicks. Pairing it with a compelling call-to-action, like “Shop Our Best Picks,” can further boost engagement.

By following these steps, you can quickly and easily add the WooCommerce shortcode for featured products to any part of your site, creating a professional and engaging shopping experience.

Common Issues and Troubleshooting

Using the WooCommerce featured products shortcode is generally straightforward, but issues can sometimes arise. Here are the most common problems you might encounter and how to resolve them.

Featured Products Not Displaying

  • Ensure Products Are Marked as Featured
    Only products explicitly marked as “featured” will show up. To verify, go to Products in your WooCommerce dashboard. Click the star icon in the “Featured” column next to the product you want to highlight. Alternatively, edit the product and check the “Featured” option in the product data settings.
  • Check for Plugin Conflicts
    Third-party plugins or themes can sometimes interfere with the shortcode functionality. Temporarily deactivate other plugins and switch to a default theme (like Storefront) to isolate the issue.
  • Update WooCommerce
    Running an outdated WooCommerce version can result in compatibility problems. Make sure your store is using the latest version of WooCommerce.

Syntax Errors in the Shortcode

The WooCommerce shortcode for featured products must follow the correct syntax. Even small mistakes can break its functionality.

  • Common Errors and Fixes
    Example of a broken shortcode: [fea​tured_​products limits="6" column="4"]
    Fix: [feature​d_p​roducts limit="6" columns="4"]
    Ensure attribute names (like limit or columns) are spelled correctly and enclosed in quotes.
  • Verify Category Filtering
    If using the category or cat_operator attributes, double-check that the category slugs match your WooCommerce setup.

Conclusion

The WooCommerce featured products shortcode remains a simple yet effective way to highlight key products in your store. While it’s an older WooCommerce shortcode, it’s still relevant for quick and easy setups.

For more flexibility, you might want to explore the newer [pro​ducts] shortcode, which supports a variety of product types and advanced configurations.

Whether you stick with [fea​​tured_products] or transition to [prod​ucts], showcasing featured items is a great way to boost product visibility and sales. Add the shortcode today, experiment with its attributes, and watch your WooCommerce store become more engaging for customers.

Customization Setup & Configuration WooCommerce

Got Questions or Ideas? Let’s Chat in the Comments!

Leave a Reply

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

Boost Your Sales with {product_name} 🚀

Create stunning sales notifications on your site with ease. Try the Lite Version of Notifal today and start seeing results!

Install Notifal Now