It seems like having a keywords meta tag in your head is nowadays bad for SEO. Does anyone know how to remove the keywords meta tag from the head in Magento 2 in a professional way?


Create a module with name STech_Removekeywords and create the files like below steps:

Step 1: Create registration.php under:


with below content:



Step 2: Create module.xml under:


with below content:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="STech_Removekeywords" setup_version="0.0.1">
            <module name="Magento_Backend"/>
            <module name="Magento_Sales"/>
            <module name="Magento_Catalog"/>

Step 3: Create di.xml under:


with below content:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Page\Config">
        <plugin name="removeMetaKeywords" type="STech\Removekeywords\Plugin\PageConfig\RemoveMetaKeywords" sortOrder="9999"/>

Step 4: Create RemoveMetaKeywords.php under:


with below content:

namespace STech\Removekeywords\Plugin\PageConfig;

class RemoveMetaKeywords
    public function afterGetKeywords($subject, string $return)
        return '';

Run setup upgrade, di compile and other required commands and test.

| improve this answer | |
  • Did you put downvote? – Sukumar Gorai Sep 17 '18 at 12:46
  • I've put upvote of course – Joris Sep 18 '18 at 11:40

Simple just remove the meta tag from the vendor\magento\module-cms\view\frontend\templates\meta.phtml Or app\design\frontend\/\Magento_Cms\templates\meta.phtml

<?php if ($pageData->getPageMetaKeywords()): ?>
       <meta name="keywords" content="<?= /* @noEscape */ $pageData->getPageMetaKeywords() ?>"/>
<?php endif; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.