Is there a way to show all meta keywords for a product on its product detail page. something looks like below? enter image description here

I'm currently able to display the meta-keyword attribute values under the email icon( I added the following code at the end of the mailto.phtml).

<div class="tags">
    <hr />
        <b><?php echo $_product->getData('meta_keyword'); ?></b>

However, I want to display them like the image above ( in individual box) and move them underneath product title. enter image description here

  • what you have tried. How you have managed Meta Keywork
    – Amit Bera
    May 28, 2020 at 6:59
  • i'm currently able to display the meta keywords underneath the email icon ( i added it at the end of the mailto.phtml). my Meta Keywords are store in the product attributes called 'meta_keyword'. thanks May 28, 2020 at 17:38

1 Answer 1


You can reach this by creating catalog_product_view.xml layout in your custom module and add your block into product.info.main container like:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="product.info.main">
            <block class="Magento\Catalog\Block\Product\View" name="meta_keywords" template="Test_Module::meta_keywords.phtml" before="-" />

meta_keywords.phtml template:

<?php /** @var \Magento\Catalog\Block\Product\View $block */ ?>

<?= $block->escapeHtml($block->getProduct()->getData('meta_keywords')) ?>
  • thank you, it get me into the right direction. May 29, 2020 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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