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-iconHTML 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.
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-iconclass includes customisable properties like background colour, padding, font size, and text transformation to make the icon stand out. - Relative Positioning: The
.productclass hasposition: relativeto 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
- Mark Products as Featured: In the WooCommerce product editor, mark your desired products as “Featured.”
- Front-End Display: The “Featured” icon will automatically appear on featured products across shop, category, tag, and search pages.
- Styling and Customisation: Customise the icon with CSS or use an image for a more personalised look.
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.
I have been working with WordPress and WooCommerce since 2012 and have developed a deep knowledge of the content management system. Since 2012, I have developed several plugins and designed dozens of websites utilising different frameworks, CMS’s and programming languages. I am proficient in PHP, Python, Java, C, C++, R and JavaScript with limited experience in Go, Kotlin and Swift.
Educationally, I have a Master’s degree in cyber security a Bachelor’s (Hons, First Class) in Applied Research and a Graduate Certificate in Data Science. I’m currently undertaking PhD studies investigating IoT cybersecurity. I recently graduated with First Class Honours and Masters of Information Technology, receiving the Executive Dean’s Award for studies undertaken in the 2021 and 2022 academic years. I have worked in the information technology industry for the past 11 years primarily as a software/web developer specific to design, optimisation, network management and security. My research interests are in the areas of Internet of Things (IoT), 5G and Beyond Networks, information security for wireless networks and software development.
Stay In Touch

