Skip to content

How to remove ‘All’ from category menu in Magento 2.4?

Magento Version:

Magento 2.4.6

Issue:

I want to remove the "All" prefix from category menu items in Magento 2. For example, currently, it shows:

  • All Why Choose Us

I want it to display:

  • Why Choose Us

What I’ve Tried:

1️⃣ Editing topmenu.phtml:

  • Located at app/design/frontend/{Vendor}/{Theme}/Magento_Theme/templates/html/topmenu.phtml
  • Used str_replace("All ", "", $_menuHtml); (Did not work)

2️⃣ Using a Translation File (en_US.csv):

  • Added "All %1","%1"
  • Deployed static content and cleared the cache

Neither method worked.

Question:

  • Where does "All" come from in the menu?
  • How can I remove or modify it properly?
  • Should I override a specific .phtml or use a custom module?

Any guidance is appreciated! Thanks in advance.

Screenshot