How do I remove and prevent auto generation of Category names from <meta name="keywords" and <meta name="description"?
How do I remove and prevent auto generation of Category names from <meta name="keywords" and <meta name="description"?
Using Zen Cart 1.5.1
Reprogram the PHP code in /includes/modules/YOUR_TEMPLATE_NAME/meta_tags.php
(if you don't have such a file, copy it from /includes/modules/meta_tags.php and make your modifications, saving them into your override folder as described above)
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
The above code on line 29 of /includes/modules/YOUR_TEMPLATE_NAME/meta_tags.php effects the Meta tag <meta name="keywords" content=" " /> and <meta name="description" content=" " />. But I can't figure out what to modify, to eliminate the top category name from appearing in the meta tags.// Get all top category names for use with web site keywords
$sql = "select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = 0 and c.categories_id = cd.categories_id and cd.language_id='" . (int)$_SESSION['languages_id'] . "' and c.categories_status=1";
$keywords_metatags = $db->Execute($sql);
while (!$keywords_metatags->EOF) {
$keywords_string_metatags .= zen_clean_html($keywords_metatags->fields['categories_name']) . METATAGS_DIVIDER;
$keywords_metatags->MoveNext();
}
define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));![]()
Using Zen Cart 1.5.1
I removed the Top Category names from <meta name="keywords" content=" " /> and <meta name="description" content=" " />
by replacing:
With:$keywords_string_metatags .= METATAGS_DIVIDER;
$keywords_string_metatags .= zen_clean_html($keywords_metatags->fields['categories_name']) . METATAGS_DIVIDER;
from /includes/modules/MyTEMPLATE/meta_tags.php at around line 29 .
Using Zen Cart 1.5.1
I think you wrote that backwards.
But even simpler would be to simply comment-out these lines:Code:$keywords_metatags = $db->Execute($sql); while (!$keywords_metatags->EOF) { $keywords_string_metatags .= zen_clean_html($keywords_metatags->fields['categories_name']) . METATAGS_DIVIDER; $keywords_metatags->MoveNext(); }
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
You are correct.
Unfortunately, I can't edit my last post anymore.
Using Zen Cart 1.5.1