How to Add a Featured Icon to Featured Products in WooCommerce on Shop, Category, Tag, and Search Pages – 2026

Last updated on November 25th, 2024 at 09:09 am

Adding a “Featured” icon to your featured products can help draw attention to these items, making them more visible to customers as they browse. This approach can help boost conversions for products you want to highlight.

In this guide, we’ll show you how to add a “Featured” icon on featured products across your WooCommerce shop, category, tag, and search pages, without using a plugin.


Step 1: Add the Featured Icon HTML to Featured Products

To display a featured icon, we need to add a small HTML element that will show up on featured products only. This involves checking if each product is marked as “Featured” and, if so, adding the icon HTML.

Code to Display the Featured Icon

Add the following code to your theme’s functions.php file or a child theme:

/*
 * Snippet: How to Add a Featured Icon to Featured Products in WooCommerce on Shop, Category, Tag, and Search Pages – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1707
* Tested with WooCommerce 10.7.0
* "This function adds a featured icon to featured products on WooCommerce archive pages"
*/ function wcsuccess_add_featured_icon() { global $product; if ( $product->is_featured() ) { echo '<span class="featured-icon">Featured</span>'; } } add_action( 'woocommerce_before_shop_loop_item_title', 'wcsuccess_add_featured_icon', 10 );

Explanation:

  • Featured Product Check: The function checks if each product is marked as featured.
  • Icon Display: If the product is featured, it adds a featured-icon HTML element that can be styled to display the icon.

Step 2: Add CSS to Style the Featured Icon

Now that the icon is displayed on featured products, we need to style it with CSS. This will allow you to create a visually appealing “Featured” label that stands out on the product grid.

See also  How to Block Bad Buyers in WooCommerce Without a Plugin - 2026

CSS for the Featured Icon

Add this CSS to your theme’s style.css file or custom CSS area:

/* Style for the featured icon */
.featured-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #f39c12;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    z-index: 10;
}

.product {
    position: relative; /* Ensure the icon positions correctly within the product */
}

Explanation:

  • Positioning: The icon is positioned in the top-left corner of each featured product.
  • Customisable Style: The featured-icon class includes customisable properties like background colour, padding, font size, and text transformation to make the icon stand out.
  • Relative Positioning: The .product class has position: relative to ensure the featured icon positions correctly within each product.

Step 3: Optional – Use a Custom Image Icon for the Featured Label

If you prefer an image icon instead of text, you can replace the Featured text with an image. Here’s how:

Code to Display an Image Icon

Replace the HTML in the PHP code with an image URL:

if ( $product->is_featured() ) {
    echo '<span class="featured-icon"><img src="https://yourwebsite.com/path-to-featured-icon.png" alt="Featured"></span>';
}

Updated CSS for Image Icon

Adjust the CSS to style the image within the featured-icon span:

.featured-icon img {
    width: 30px; /* Adjust size as needed */
    height: auto;
}

Explanation:

  • Custom Icon: You can use a custom image to display a more stylised icon.
  • Icon Sizing: Adjust the width in the CSS as needed to fit your design.

Example Workflow

  1. Mark Products as Featured: In the WooCommerce product editor, mark your desired products as “Featured.”
  2. Front-End Display: The “Featured” icon will automatically appear on featured products across shop, category, tag, and search pages.
  3. Styling and Customisation: Customise the icon with CSS or use an image for a more personalised look.
See also  WooCommerce Hide Specific Products for Certain Users - 2026

Conclusion

Adding a featured icon to WooCommerce products can help you draw attention to highlighted items, encouraging customers to explore them further. By following this guide, you can display a “Featured” icon on products across your WooCommerce shop, category, tag, and search pages without a plugin.

For more customisation options, explore our WooCommerce Visual Hooks Guide or our wp-config generator for advanced configurations.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
×