cancel
Showing results for 
Search instead for 
Did you mean: 

How to display Category and Sub Category meta tags in view pagesource?

How to display Category and Sub Category meta tags in view pagesource?

Hi,

 

I am not a Magento developer and I really need to display the meta title, descriptions and keywords on my website for catalog categories and sub-categories. Right now it is pulling the default meta tags set-up in the CMS. 

 

The cms pages seems to be working fine. I used this code and paste in on /cms/meta.phtml file:

<?php if($pageData->getPageMetaKeywords()): ?>
<meta name="keywords" content="<?php echo $pageData->getPageMetaKeywords() ?>" />
<?php endif; ?>
<?php if($pageData->getPageMetaDescription()): ?>
<meta name="description" content="<?php echo $pageData->getPageMetaDescription() ?>" />
<?php endif; ?>

 

However, I need a codes how to display the meta tags information for catalog sub-categories pages. The sample URL key of my catalog sub category is something like this /gift.html#cat=154

 

PLEASE HELP ME! Smiley Sad 

I am reading and trying out a lot of suggesstions from the internet but none of it is working. 

 

Thanks in advance.

 

J.

 

2 REPLIES 2

Re: How to display Category and Sub Category meta tags in view pagesource?

<meta> tags should be only in <head> tag, and it should be defined once per page.

It's working out of the box with Magento, you can set it by going to any Magento product / category Edit page in the Admin, there you can set everything you want.

 

If you try to set multiple <meta> tags on the same page, then it will not have any effect in best case, in worst case search engines will not like that.

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue

Re: How to display Category and Sub Category meta tags in view pagesource?

This was happening due to Creare SEO extension.

You should remove this extension.