How can I move breadcrumb before main title on Magento 2

How can I move breadcrumb before main title on Magento 2

July 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How can I move breadcrumb before main title on Magento 2

Moving Breadcrumb Before Main Title on Magento 2

As a new developer exploring the vast landscape of Magento 2, you’re likely to encounter common layout challenges like moving elements around in your storefront. One such issue that often puzzles beginners is how to move the breadcrumb before the main title—whether it’s on category pages or product listings.

In this guide, we’ll walk through a step-by-step process to achieve this using Magento 2’s layout XML and theme customization features. By the end of this article, you should have a clear understanding of where to find the necessary files and how to modify them correctly.

Understanding the Layout Order

Before diving into the code, it’s essential to understand that in Magento 2, the order of elements is determined by the layout XML files located under app/design/frontend/[Vendor]/[Theme]/layout. These files define the structure and flow of content on your storefront pages.

For category pages, the primary layout file responsible for this functionality is catalog_category_view.xml. For product pages, it’s typically defined in the catalog_product_view.xml file within the same directory structure.

Customizing the Layout

To move the breadcrumb before the main title, you’ll need to create a new XML layout update file and override the existing ones. Here are the specific steps:

  1. Create an XML file for your custom layout updates.

    Navigate to your theme’s layout folder:

    app/design/frontend/[Vendor]/[Theme]/layout
    
  2. Add the necessary move element directive.

    Create a new XML file, e.g., custom_category.xml (for category pages) or custom_product.xml (for product pages), and add the following line inside:

    <move element="breadcrumbs" destination="page.top" before="page.main.title"/>
    
  3. Reference your custom XML file in the Magento configuration.

    Open your theme’s theme.xml file, located at:

    app/design/frontend/[Vendor]/[Theme]/etc/view/theme.xml
    

    Add a new <layout> node referencing your custom layout update:

    <layout xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Theme:etc/layout.xsd">
        <update handle="custom_category" file="Magento_Theme::custom_category.xml" />
    </layout>
    
  4. Clear the Magento cache and refresh your storefront.

    After making these changes, run the following commands in your terminal to clear the cache:

    php bin/magento cache:flush
    php bin/magento setup:upgrade
    

    Then, navigate back to your category or product pages. You should now see the breadcrumb moved before the main title.

Conclusion

Moving elements around in Magento 2 requires a solid understanding of its layout XML structure and theme customization process. By following this guide, you’ve learned how to create custom layout update files and reference them within your theme’s configuration to achieve specific layout changes like moving the breadcrumb before the main title on category or product pages.

Remember that Magento 2 provides extensive documentation at https://laravelcompany.com/magento-2-documentation for further reference as you continue your exploration of this powerful e-commerce platform.

Magento 2 Catalog Themes Orders

Our network