Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Remove category name from meta

    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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove category name from meta

    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.

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Remove category name from meta

    Quote Originally Posted by DrByte View Post
    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?
    Using Zen Cart 1.5.1

  4. #4
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Remove category name from meta

    Quote Originally Posted by DrByte View Post
    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.
    Using Zen Cart 1.5.1

  5. #5
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Remove category name from meta

    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 .
    Using Zen Cart 1.5.1

  6. #6
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove category name from meta

    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.

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Remove category name from meta

    You are correct.

    Unfortunately, I can't edit my last post anymore.
    Using Zen Cart 1.5.1

 

 

Similar Threads

  1. Remove Store Name from <meta name="description" content=
    By Podgeminster in forum General Questions
    Replies: 9
    Last Post: 14 Jul 2016, 06:16 PM
  2. v150 remove link from category name
    By godt in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 20 Mar 2012, 07:28 AM
  3. Remove category names from facebook meta tags
    By hockey2112 in forum General Questions
    Replies: 4
    Last Post: 27 Feb 2012, 05:31 PM
  4. remove category name from product listings
    By riotproject in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Aug 2008, 01:00 AM
  5. How to remove category name from category page?
    By faithofgod in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 1 Mar 2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg