Forums / Templates, Stylesheets, Page Layout / Automatic Meta tags generation

Automatic Meta tags generation

Locked

Views: 17,767

Results 41 to 55 of 55
This thread is locked. New replies are disabled.
6 Oct 2008, 5:48 PM
#41
pet_herbal_remedies avatar

pet_herbal_remedies

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

http://www.PetHerbalRemedies.com

25 Feb 2009, 11:11 PM
#42
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Re: Automatic Meta tags generation

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...
25 Feb 2009, 11:14 PM
#43
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Automatic Meta tags generation

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.

25 Feb 2009, 11:40 PM
#44
all4coffee avatar

all4coffee

Zen Follower

Join Date:
Jul 2007
Posts:
154
Plugin Contributions:
0

Re: Automatic Meta tags generation

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!

26 Feb 2009, 12:07 AM
#45
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Automatic Meta tags generation

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.

15 Apr 2009, 2:13 AM
#46
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: Automatic Meta tags generation

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

22 Apr 2009, 9:24 PM
#47
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Automatic Meta tags generation

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!

22 Apr 2009, 9:54 PM
#48
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Automatic Meta tags generation

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.

22 Apr 2009, 10:18 PM
#49
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Automatic Meta tags generation

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!

22 Apr 2009, 11:16 PM
#50
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Automatic Meta tags generation

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.

22 Apr 2009, 11:46 PM
#51
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Automatic Meta tags generation

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!

22 Apr 2009, 11:51 PM
#52
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Automatic Meta tags generation

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!

24 Apr 2009, 7:34 PM
#53
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Automatic Meta tags generation

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.

24 Apr 2009, 11:10 PM
#54
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Automatic Meta tags generation

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.

28 Jun 2010, 4:23 PM
#55
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Automatic Meta tags generation

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