How to Show Breadcrumbs on Product Page in Magento 2
Have you ever landed on a website and got lost? I bet you must have just abandoned that site instead of finding the way out.
Had it been the breadcrumbs, the situation would be different. Breadcrumbs would have guided you through the site and help find the desired page!
Today, in this post, I have come up with breadcrumbs, their benefits, and how to enable them in Magento 2.
If you want to improve the navigation and crawlability of your Magento 2 store, continue reading.
In case you are customizing your product page, you may also use a custom price template in Magento 2 to change the way prices are displayed on it.
What are Breadcrumbs?
Breadcrumbs are not only helpful little pointers to indicate the position of a page within a website hierarchy but also an easier way to track back from the current page.
It’s an essential part of the website that helps users quickly find what they are looking for especially when the store consists of a large number of categories, products, and subcategories.
It usually appears at the top of the page which are horizontally arranged links separated by greater than (>) sign in the Magento 2 store.
ie.: Home > Category > Sub Category > Product
Benefits of Showing Breadcrumbs on Product Page in Magento 2
- Improve UX and navigation
- Improves SERP rankings
- Enhance user experience
- Reduce bounce rates and keep your visitors on the website for longer time period
- Present the site in an organized and structured manner.
- Allow your visitors to better understand the structure/layout of your website.
- Implementing breadcrumb schema markup improves the click-through rate from search.
- Improve the internal linking of your website for better Magento 2 SEO.
In Magento 2, not every theme supports breadcrumbs on the product page that’s why you need to show breadcrumbs on product page in Magento 2 using the below method:
Method to Show Breadcrumbs on Product Page in Magento 2
Add the below code to your product page layout(xml) file :
1 2 |
<referenceBlock name="breadcrumbs" template="Magento_Theme::html/breadcrumbs.phtml"/> <block class="Magento\Catalog\Block\Breadcrumbs"/> |
If you have any doubts regarding this post, just mention them in the Comments section below.
I would be happy to help.
If your business requirements demand to remove breadcrumbs from the product page in Magento 2, you can do so using the solution posted in our blog.
Feel free to share the solution with Magento Community via social media.
Thank You.
Chandresh Chauhan
He has been with Meetanshi for more than three years now as a certified Magento developer. A silent guy whom you can always find solving clients' issues, is an avid reader too.
2 Comments
Awesome
Love this solutions
Thanks a trilion
Thank You For Your Appreciation,
We are Glad to Know That Our Solution was so Helpful to You!!