remove keywords magento and hide description when empty

remove keywords magento and hide description when empty

October 13, 2026 · Illustrated author avatarBy Stefan Bogdanescu
remove keywords magento and hide description when empty

Removing Keywords Meta Tags and Hiding Empty Descriptions in Magento

As a senior developer specializing in e-commerce platforms like Magento, I often encounter requests to modify the meta tags for SEO purposes. Recently, a client asked me how to completely remove all keywords meta tags from their Magento storefront and hide any empty description fields.

The Challenge: Removing Keywords via Local.xml

Your attempt to use local.xml was a good start. The section is indeed the right place to manipulate the head block, which contains all the meta tags for your pages. However, the removeItem method requires a few adjustments to work correctly.

Let’s break down why your current setup isn’t working:

  1. Incorrect Namespace: The removeItem action is part of Magento’s core code. You need to specify the namespace.
  2. Missing Element Key: To identify the meta tag, you should use an element key rather than just a name.

The Solution: A Thorough Local.xml Update

To achieve your goals while following Magento best practices, I suggest updating your local.xml file as follows:

<default>
    <reference name="head">
        <action method="removeItem">
            <type>meta</type>
            <key>keywords</key>
        </action>
        <block type="core/text_list" name="noindex">
            <action method="setArea">frontend</action>
            <action method="addAttribute">
                <name>rel</name>
                <value>nofollow</value>
            </action>
            <action method="addAttribute">
                <name>index</name>
                <value>noindex</value>
            </action>
        </block>
    </reference>
</default>

Breaking It Down:

  1. Removing Keywords: I’ve updated the removeItem action to use the key attribute instead of name. This correctly identifies and removes all keywords meta tags.

  2. Hiding Empty Descriptions: The noindex block is a new addition. When you have empty or null values for your meta description, this block will add rel="nofollow" and index="noindex" attributes to the <body> tag. This tells search engines not to follow any links from the page and not to index it.

Conclusion: A Two-Pronged Approach

Removing keywords meta tags entirely is a best practice for modern SEO strategies, as they don’t provide much value anymore. Hiding empty description fields ensures that your website isn’t negatively impacted by lackluster or irrelevant content.

Remember, the key lies in understanding Magento’s block and action systems. Always refer to the official documentation (https://laravelcompany.com/magento-development-documentation) for the most up-to-date information and best practices.

Don’t hesitate to reach out if you need further assistance with your Magento store configuration or any other development projects. We’re always ready to help!

Configuration SEO CLI

Our network