Skip to main content
1 of 2
David Verholen
  • 6.3k
  • 1
  • 20
  • 38

I just had to do the same and decided to just add a plugin after the getKeywords Method of the page config which returns a null string. works great

di.xml:

<?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="Vendor\Module\Plugin\PageConfig\RemoveMetaKeywords" sortOrder="9999"/>
    </type>
</config>

Plugin Class:

<?php
declare(strict_types = 1);
namespace Vendor\Module\Plugin\PageConfig;

class RemoveMetaKeywords
{
    public function afterGetKeywords($subject, string $return)
    {
        return (string)null;
    }
}
David Verholen
  • 6.3k
  • 1
  • 20
  • 38