Totally Zenned
- Join Date:
- Dec 2012
- Posts:
- 607
- Plugin Contributions:
- 0
Remove category name from meta
How do I remove and prevent auto generation of **Category **names from <meta name="keywords" and <meta name="description"?
Views: 934
Totally Zenned
How do I remove and prevent auto generation of **Category **names from <meta name="keywords" and <meta name="description"?
Sensei
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)
Totally Zenned
DrByte:
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)
I was just looking at that file in my override. I couldn't figure were they were getting generated? Where should I be looking at?
Totally Zenned
DrByte:
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)
// 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));
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.:blush:
Totally Zenned
I removed the Top Category names from <meta name="keywords" content=" " /> and <meta name="description" content=" " />
by replacing:
$keywords_string_metatags .= METATAGS_DIVIDER;
With:
$keywords_string_metatags .= zen_clean_html($keywords_metatags->fields['categories_name']) . METATAGS_DIVIDER;
from /includes/modules/MyTEMPLATE/meta_tags.php at around line 29 .
Sensei
I think you wrote that backwards.
But even simpler would be to simply comment-out these lines:```
$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();
}
Totally Zenned
You are correct.
Unfortunately, I can't edit my last post anymore.
Tell staff why this post should be reviewed.