---
title: "How to Add Custom Meta tag in Product View Page in Magento 2?"
url: "https://magecomp.com/blog/add-custom-meta-tag-in-product-view-page-in-magento-2/"
date: "2021-07-10T10:19:33+00:00"
modified: "2025-02-19T05:31:51+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 336
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "Instead of adding custom meta tags for all pages, you can add for a specific product page. Learn How to Add Custom Meta tag in Product View Page in Magento 2"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Guide for Magento 2 Product Review Import Export"
    url: "https://magecomp.com/blog/guide-for-magento-2-product-review-import-export/"
  - title: "Magento 2 Both Including &#038; Excluding Tax Price Show Only On Product Detail Page"
    url: "https://magecomp.com/blog/magento-2-both-including-excluding-tax-price-show-only-on-product-detail-page/"
  - title: "How to Call Controller when hit any URL from Website in Magento 2?"
    url: "https://magecomp.com/blog/call-controller-when-hit-any-url-from-website-magento-2/"
---

# How to Add Custom Meta tag in Product View Page in Magento 2?

_Published: July 10, 2021_  
_Author: Dhiren Vasoya_  

![How to Add Custom Meta tag in Product View Page in Magento 2](https://magecomp.com/blog/wp-content/uploads/2021/07/How-to-Add-Custom-Meta-tag-in-Product-View-Page-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

I am back with another Magento solution for you. Today’s topic is How to Add Custom Meta tag in Product View Page in Magento 2.
[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-6.webp)](https://magecomp.com/services/hyva-theme-development/)

Meta tags provide information about the page to web browsers and search engines. Meta tags are found on the source code of the page. With the help of meta tags, search engines come to know what the page is about.
If you need a custom meta tag for a specific product page in Magento 2, it can be accomplished with the help of the below code. To create a custom meta tag you need not add a custom block, you can use the default block. You can even add as many meta tags as you want.
Let’s start with the Steps on How to Add Custom Meta tag in Product View Page in Magento 2
## Steps to Add Custom Meta tag in Product View Page in Magento 2:
**Step 1:** Go to the below-given path.
**app\design\frontend\Themes\Yourtheme\Magento_Catalog\layout\catalog_product_view.xml**

Now, add the code as mentioned below
```
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="head.additional">
            <block class="MagentoCatalogBlockProductView" name="meta_type_name" template="Magento_Catalog::product/view/custom_meta_name.phtml" />
        </referenceBlock>
     </body>
</page>
```

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-3.webp)](https://magecomp.com/services/magento-upgrade-services/)

**Step 2:** Create a file named **custom_meta_name.phtml** at the following path
**app\design\frontend\Themes\Yourtheme\Magento_Catalog\templates\product\view\**

Finally, add the below code
```
<meta property="og:your_custom_tag_name" content="your_custom_value" />
```

## Conclusion:
Accordingly, you can Add a Custom Meta tag to Product View Page in Magento 2. Our [**SEO Service**](https://seo.magecomp.com/) can help to increase traffic and rankings of your Magento 2 store. For queries, mention it in the comment part. Share with your friends and stay in touch with us!
[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-3.webp)](https://magecomp.com/magento-performance-optimization.html)

**Happy Reading!**

</body>


---

_View the original post at: [https://magecomp.com/blog/add-custom-meta-tag-in-product-view-page-in-magento-2/](https://magecomp.com/blog/add-custom-meta-tag-in-product-view-page-in-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-21 22:31:56 UTC_  
