Showing results for 
Search instead for 
Did you mean: 

Separating H1 from menu links

Separating H1 from menu links

Hi, is it possible for the menu labels for category pages in the main nav to be different than the H1 headers on the page? We'd like to be able to separate them for SEO reasons so we can optimise the H1 without affecting the menu, but our web support company says this isn't possible. Thanks.


Re: Separating H1 from menu links

Hello @danverghesef0c 


  1. In your custom theme, create a new template file that overrides the default navigation rendering. The template file responsible for rendering the main navigation menu is typically located at app/design/frontend/[Vendor_Name]/[Theme_Name]/Magento_Theme/templates/html/topmenu.phtml. Copy this file to the corresponding location in your custom theme.

  2. In the overridden topmenu.phtml file, you can modify the logic that generates the menu labels. You can change how category names are displayed or introduce additional attributes or variables to control the menu labels separately from the H1 headers on the category pages.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now