Zen Follower
- Join Date:
- Aug 2008
- Posts:
- 162
- Plugin Contributions:
- 0
Automatic Meta tags generation
Dr. Byte,
Thank you for clearing up the obvious! Looking too deeply can often be the problem for me!
Huge Thanks,
Lynn
Views: 17,767
Zen Follower
Dr. Byte,
Thank you for clearing up the obvious! Looking too deeply can often be the problem for me!
Huge Thanks,
Lynn
Zen Follower
Qwert302:
// Per-Page meta-tags. Follow this pattern for individual pages you wish to override. This is useful mainly for additional pages.
// replace "page_name" with the UPPERCASE name of your main_page= value, such as ABOUT_US or SHIPPINGINFO etc.
// repeat pattern as necessary
define('META_TAG_DESCRIPTION_page_name','');
define('META_TAG_KEYWORDS_PAGE_page_name','');
define('META_TAG_TITLE_PAGE_page_name', '');
>
> You can set them per page with this code.
Would someone know where to exactly place the above code in the meta-tags.php file? I'm trying to define unique meta_tags for one of my define pages...
Sensei
It goes in your meta_tags.php language file, but only works in v1.3.8 and newer. You'll see the existing examples already in the file.
.
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.
Zen Follower
DrByte:
It goes in your meta_tags.php language file, but only works in v1.3.8 and newer. You'll see the existing examples already in the file.
Thanks. Yes - this is the right location but there was a typo in the given code. The two highlighted in red sections need to be removed from the code. I placed it around line 47 just above the
// favicon setting entry
// Per-Page meta-tags. Follow this pattern for individual pages you wish to override. This is useful mainly for additional pages.
// replace "page_name" with the UPPERCASE name of your main_page= value, such as ABOUT_US or SHIPPINGINFO etc.
// repeat pattern as necessary
define('META_TAG_DESCRIPTION_page_name','');
define('META_TAG_KEYWORDS_PAGE_page_name','');
define('META_TAG_TITLE_PAGE_page_name', '');
It does seem to work with my v. 1.3.7
http://www.all4coffee.com/index.php?main_page=page_2
Thanks again!
Sensei
That is correct ... bug report here: http://www.zen-cart.com/forum/showthread.php?t=110210 ... fixed in 1.3.9 and newer
.
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.
Zen Follower
I'm confused by this thread. I'm running 1.3.8a. Here's the modified part of my meta_tags.php below.
// page title
define('TITLE', 'Adamant Barbell');
// Site Tagline
define('SITE_TAGLINE', 'Home Gym Exercise & Fitness Equipment');
// Custom Keywords
define('CUSTOM_KEYWORDS', 'gym equipment, strength equipment, exercise equipment, exercise machines, home gyms');
// Home Page Only:
define('HOME_PAGE_META_DESCRIPTION', 'Online store to buy gym equipment, exercise machines, home gyms, cardio equipment, barbells, dumbbells, weights, and lots of accessories.');
define('HOME_PAGE_META_KEYWORDS', 'gym equipment, exercise equipment, cardio equipment, workout equipment, weights, gym weights, barbell, weight bench');
The problem is Zen is putting my category names into the meta keywords for each product page. I'd like to remove them. Example below, taken from the page source when viewing the page in a browser. The last several keywords are my CUSTOM_KEYWORDS, which is perfect. I'd like to remove the category names from it. How should I go about doing so?
<meta name="keywords" content="Power Systems Leg Press / Hack Squat [ps-46164], Home Gyms, Power Racks/Cages, Hand & Forearm, Dumbbells, Olympic Weights, Misc. Accessories, Standard Weights, Inversion Systems, Belts, Gloves & Straps, Bars, Cardio Equipment, Medicine Balls, Body Weights, Kettlebells, Machines, Fixed Barbells, Yoga & Pilates, Mats & Flooring, Wraps/Supports, Rubber Bands/Tubes, Abdominal Exercisers, Stability & Balance, Contour-Weights, Jump Ropes, Media, Rebounders, Storage Racks, Benches, Pull Up Bars, Testing & Measurement, Platforms, gym equipment, strength equipment, exercise equipment, exercise machines, home gyms" />
I'm defining all my category meta keywords and descriptions manually, so it's really only product pages that's the issue. I'll get to EZ pages and whatnot too, but one thing at a time!
Adamant Barbell - Home & commercial gym equipment - Since 2007
www.adamantbarbell.com
Totally Zenned
I am trying to figure out how to remove the addition of site title to each product title metatag. Can someone please point me in the right direction. Thanks!
Isaacola
Online Shopping Mall
Sensei
BlessIsaacola:
I am trying to figure out how to remove the addition of site title to each product title metatag. Can someone please point me in the right direction. Thanks!
Edit each product and set Title/Tagline to No.
.
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.
Totally Zenned
DrByte:
Edit each product and set Title/Tagline to No.
Since that would require editing 20,000+ products I changed lines 289-291 in includes/modules/meta_tags.php from:
define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TAGLINE));
define('META_TAG_DESCRIPTION', str_replace('"','',TITLE . ' ' . $meta_products_name . SECONDARY_SECTION . $products_description . ' '));
define('META_TAG_KEYWORDS', str_replace('"','',$meta_products_name . METATAGS_DIVIDER . KEYWORDS));
to:
define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TAGLINE));
define('META_TAG_DESCRIPTION', str_replace('"','',$meta_products_name . SECONDARY_SECTION . $products_description . ' '));
define('META_TAG_KEYWORDS', str_replace('"','',$meta_products_name . METATAGS_DIVIDER . KEYWORDS));
That took care of both the site title being added to product title as well description.
Thanks!
Isaacola
Online Shopping Mall
Sensei
As long as you remember that now you have more custom code that is now inconsistent with the data in your database ...
.
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.
Totally Zenned
DrByte:
As long as you remember that now you have more custom code that is now inconsistent with the data in your database ...
Does this mean that Zen Cart doesn't generate meta tags on the fly? I thought only custom meta tags entered from the admin are stored in the database.
Can you please clarify your comment with regards to inconsistency? Thanks!
Isaacola
Online Shopping Mall
Totally Zenned
Okay, I just checked the two meta tags table and the only product or category with stored information are products and categories that I entered meta tags for manually from the admin side. Now I am really anxious to know what you mean by inconsistency.
Thanks!
Isaacola
Online Shopping Mall
Sensei
I was referring to the fact that you hard-coded a change to a core file, causing your site to ignore the data that's in the database when producing metatags. You did this because you don't want to update all your products.
This means that now you have data settings in your database that says "do it this way", but you are using altered code that ignores the settings in your database.
Thus, unless you make yourself some good notes, you're going to have to be sure to re-customize your code anytime you attempt an update.
However, if you were to simply update the data in your database, you wouldn't have to deal with the custom code, because the data and the core code would be consistent with each other.
.
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.
Totally Zenned
DrByte:
However, if you were to simply update the data in your database, you wouldn't have to deal with the custom code, because the data and the core code would be consistent with each other.
How exactly would suggest I do this? I do not see any admin switch to turn of the addition of site title to meta tags or product description when no custom meta tag is defined.
I turned off the title tag by changing Show Metatags Title Default - Product Title to "false" on the admin side under product layout edit but that didn't make any difference.
Isaacola
Online Shopping Mall
Totally Zenned
BlessIsaacola:
How exactly would suggest I do this? I do not see any admin switch to turn of the addition of site title to meta tags or product description when no custom meta tag is defined.
I turned off the title tag by changing Show Metatags Title Default - Product Title to "false" on the admin side under product layout edit but that didn't make any difference.
Did you get this resolved? I am trying to figure out meta tags, etc.
Thanks, Kim
kburner
Burner Christian Bookstore
https://www.burnerbooks.com
Tell staff why this post should be reviewed.