Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Add Robots to Category Meta

Add Robots to Category Meta

Views: 1,002

Results 1 to 5 of 5
16 Feb 2026, 5:29 PM
#1
greg_beyer avatar

greg_beyer

New Zenner

Join Date:
Mar 2016
Location:
Marietta GA
Posts:
85
Plugin Contributions:
0

Add Robots to Category Meta

Hello, I'd like to remove one product category from google indexing. I've read posts here about how to do so via the robots.txt file. However, according to Google using robots.txt file is not the way to go. (https://developers.google.com/search/docs/crawling-indexing/block-indexing). Bottom line, Goog, and others have to crawl a page to see a meta tag to honor that it not be indexed.

Under category meta, there are two tags available: keywords and description. I would like to add a third meta tag - robots. And in that tag, I would put noindex, follow. Using developer toolkit, I found two files where " Categories Meta Tags Definitions" are. I've thought to add lines to them for robot meta as shown below, simply following the pattern of the existing meta tags fields. However upon refreshing my category view, the Robots meta tag doesn't show up. So I'm apparently missing something else I need to create a Robots meta tag for categories. Any suggestions on how I could accomplish this?

/public_html/<admindir>/includes/languages/english/categories.php

added the line:

define('TEXT_EDIT_CATEGORIES_META_TAGS_ROBOTS', 'Robots:');

added the line:

/public_html/<admindir/includes/languages/english/lang.categories.php

'TEXT_EDIT_CATEGORIES_META_TAGS_ROBOTS' => 'Robots:',

Thanks!

19 Feb 2026, 4:30 PM
#2
greg_beyer avatar

greg_beyer

New Zenner

Join Date:
Mar 2016
Location:
Marietta GA
Posts:
85
Plugin Contributions:
0

Re: Add Robots to Category Meta

:D Did some more searching of the forums with different terms on my issue, found a 2006 post an exactly the same question - https://www.zen-cart.com/showthread.php/35308-Adding-other-meta-tags.

Also in another post (darn I didn't save the url) someone mentioned a "meta_tags.php" file, which I didn't come across in my search, above. So I went looking again with Dev Tool Kit . . . no joy. IS there such a file I just didn't search for quite right? Not finding with a search using my FTP client, either.

19 Feb 2026, 4:47 PM
#3
greg_beyer avatar

greg_beyer

New Zenner

Join Date:
Mar 2016
Location:
Marietta GA
Posts:
85
Plugin Contributions:
0

Re: Add Robots to Category Meta

welp, I finally found it -- /includes/modules/meta_tags.php. But, gad, "define" is in there only 94 times :ohmy: Got no idea how I would edit it correctly to add a meta tag for robots. Please help?

1 Mar 2026, 10:45 PM
#4
greg_beyer avatar

greg_beyer

New Zenner

Join Date:
Mar 2016
Location:
Marietta GA
Posts:
85
Plugin Contributions:
0

Re: Add Robots to Category Meta

any guidance on editing the /includes/modules/meta_tags.php to add a new metatag would be appreciated. Thx

2 Mar 2026, 12:45 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: Add Robots to Category Meta

greg_beyer:

any guidance on editing the /includes/modules/meta_tags.php to add a new metatag would be appreciated. Thx
Using the template-override system (https://docs.zen-cart.com/user/template/template_overrides/#introduction), you would first copy /includes/modules/meta_tags.php to /includes/modules/YOUR_TEMPLATE/meta_tags.php, where YOUR_TEMPLATE is the name of the site's current template.

Next, you'd edit that template-override copy of a Zen Cart core-file, adding the highlighted section to the bottom of the file:

...

$zco_notifier->notify('NOTIFY_MODULE_META_TAGS_OVERRIDE', $metatag_page_name, $meta_tags_over_ride, $metatags_title, $metatags_description, $metatags_keywords);

// meta tags override due to 404, missing products_id, cPath or other EOF issues
if ($meta_tags_over_ride === true) {
    zen_define_default('META_TAG_TITLE', $metatags_title);
    zen_define_default('META_TAG_DESCRIPTION', $metatags_description);
    zen_define_default('META_TAG_KEYWORDS', $metatags_keywords);
}
[B]
// -----
// Tell all search engines not to index the specified category (13 for this example)
//
if (isset($_GET['cPath']) && (int)$_GET['cPath'] === 13) {
?>
<meta name="robots" content="noindex">
<?php
}[/B]

// This should be last line of the script:
$zco_notifier->notify('NOTIFY_MODULE_END_META_TAGS');