0

I have configured OG tags in "default_head_blocks.xml" head section ,then I open index page in view page source og tags are not there.

<meta property='og:title' content="test" />
    <meta property="og:type" content="website"/>
    <meta property='og:description' content="test" /> 
    <meta property='og:url' content="test" />
    <meta property='og:image' content="test" />

can any body suggest proper way to do this.I'm using Magento 2.3 Thank you.

0

You need to put it in respective specific XML files like below:

  1. CMS Page :- cms_index_index.xml
  2. Product Page :- catalog_product_view.xml
  3. Category Page :- catalog_category_view.xml

If any other custom page has been made on your store then you need to put this xml file code into that custom layout xml file as well.

I hope this help to you. Let me know if you need any further help.

Happy to help!

Thanks,

| improve this answer | |
  • thank you . there are couple of cms_index_index.xml file can see. could you tell me exact file location ? – Ravi May 13 at 5:45
  • Welcome @Ravi, you need to consider the one which is available in "module-cms" magento core module. In fact, you need to create these 3 files in your custom module or theme and need to include your custom block (responsible to add OG code in head) inside all the files. – Pratik Navapara May 13 at 7:20
  • I have created "cms_index_index.xml" and added meta tags inside the head , is it okay? sorry , I'm new for magento back end development, – Ravi May 13 at 8:37

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.