I am trying to create promotional pages for our magento site to run marketing campaigns from. It is very important for us to be able to share these pages on social, which means editing the open-graphs for each page so the correct image appears etc.

Is there any way for me to access the header HTML for individual pages so I can input my own meta-tags?

So far I can only add text for title and description in the back end, but images for individual pages (other than product pages) aren't proving to easy, unless I'm missing something?

  • Which magento version are you using? and you want to set meta tag for product page or cms page? – Murtuza Zabuawala Aug 22 '16 at 10:25
  • Version, I want to set meta tags for a category page. I have created a category called promotions for which I will add a sub-category for each marketing campaign. – Freddie.B Aug 23 '16 at 11:35

You can add Meta tag for category page from admin panel Just Follow image to add meta Keywords and Description enter image description here

Or Go to app/design/frontend/yourpackage/yourtheme/template/page/html/head.phtml

and put below code

<?php if(Mage::registry('current_category')):?>
<meta property="og:image" ><!--Your meta tag for category-->

<?php endif; ?>
  • Thanks @murtuza, but how do I change the <meta property="og:image" - ?? Currently the image that facebook etc pulls through is just our logo and it's also the wrong size, I have an image in mind but don't know where to put it... – Freddie.B Aug 23 '16 at 12:35
  • please check my updated answer – Murtuza Zabuawala Aug 23 '16 at 13:39
  • Have you do the changes or need some help for this Yet? – Murtuza Zabuawala Aug 25 '16 at 6:45

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.