Forums / General Questions / How to auto generate just product keywords from product page?

How to auto generate just product keywords from product page?

Views: 3,110

Results 1 to 20 of 22
24 Feb 2012, 9:17 PM
#1
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

How to auto generate just product keywords from product page?

Hello All,

I am deeply frustrated with the automated keyword generator. I have an enormous database of almost 12,000 products and I am perfectly fine with automatic keyword generation... if those keywords came from the product description.

Instead, my ZC scoops up a list of categories and inserts that as my meta keywords. Only 1 category is pertinent to any given product. The rest is useless clutter.

++++++++++
Here is an actual example:
I sell parts to repair medical equipment. A customer might search google for Shaft Link for Stryker 811 Autopsy Saw.

In the product description I have listed my part number, after market part numbers, and list of about 12 other models this same product fits.... all great key words.

Instead of using that, my ZC scoops a list of categories that are 100% irrelevant to my potential customer: Cast Cutters, Autoclaves and Sterilizers, Centrifuges, Dental Chairs, Infant Incubators, etc etc
++++++++++

Is there a way to re-direct the keyword generator? I think it is scooping up hyper links instead of non-linked text.

Maybe there is a php file controlling where ZC looks for key words? I assume that the product page is tagged with a beginning and end. Maybe I can edit the offending code to look within those product tags?

I would be extremely grateful if someone could help me!

Thanks in advance,
Mike

25 Feb 2012, 5:22 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

If you understand PHP, you can customize the code in /includes/modules/YOUR_TEMPLATE_FOLDERNAME/meta_tags.php to do as you wish. The code in the early section of that file grabs the category names and uses them for partial content in keywords. The rest of the file then builds content based on page-specific information, depending what page the visitor is on. If the category stuff is truly irrelevant (and you're absolutely certain that it wouldn't be better to actually remove irrelevant categories from your database instead of editing code), then adjusting the category-related keyword code in that file might be an option for you to consider.

.
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 2012, 10:13 PM
#3
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Hi DrByte,

Thanks for pointing me in the right direction once again!

Here is the code I found:

// 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));

Can I simply delete that entire passage?

Thanks,
Mike

25 Feb 2012, 10:20 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

Again, I give a disclaimer: You should not be altering these parts of the code unless you have a VERY SOLID business reason for doing so. Way too many people start hacking away without actually properly fixing the CONTENT in their categories, category names, products, product descriptions, etc, all in the name of thinking they're experts in SEO, when in fact Zen Cart is very intentionally doing these things FOR YOUR BENEFIT. It's a rare situation that legitimately needs alteration to this section of the code.

So, that said, if you've carefully assessed your categories and products, and feel that you need to keep categories in your store which have no relevance to SEO and thus are causing you problems, then you can override the normal intelligence by making adjustments to the code.

The section of code you quoted is what builds the category names into the default keywords.

A simpler way to bypass its use would be to define the KEYWORDS constant in your /includes/languages/YOUR_TEMPLATE_NAME/meta_tags.php file. That would prevent the code you quoted from being able to add the categories to it at all.

.
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 2012, 10:49 PM
#5
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Thanks again DrByte!

I am, as a matter of mathematically provable fact, an SEO expert. Not to come off as cocky, just pointing out a truth. :cool:

I'll explain my logic in a moment. But first, I don't know how to 'adjust code, but I do not how to press the delete button. :P

If I delete this passage, will my ZC simply skip the top level categories when it automatically creates meta keywords? Again, I want the automated meta generation... I just want to skip the top level categories.

Thanks!

25 Feb 2012, 11:06 PM
#6
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Ok, logic... (I think I am pointing out a minor flaw in an otherwise awesome system, so I will take my time to explain)

With regard to unrelated categories not being pertinent to specific products... this is actually very logical and I expect it is precisely the same truth on MOST websites.

I have 22 top level categories, with approximately 700 subcategories going three clicks deep, leading to 11,600 product pages. The only place that the top level categories are pertinent is on my main pages (index, about us, etc). That should be the same on every site.

Once you choose a top category, you have decided that the other 21 categories do not interest you. This is logical, makes sense, and is exactly how it should be. Not just on my site, but EVERY site.

If all 22 categories interest you, then you will spend a very long, very frustrating time on my site.

Maybe medical stuff is harder to relate to, so let's talk cars. Let's say you have a Ford Pinto sitting in your front yard that needs a new alternator. You visit a car part website that has 22 makes as top level categories (Ferrari, Mazda, Honda, etc, and, of course, Ford).

Since you have a Ford, nothing else matters. Next you pick your year, no other categories matter (just as it should be). Now you pick your model and so on.

But just because you have a Ford does not mean that the other categories should not matter to the next guy (or search engine bots)! It just does not matter to the specific part you want (or that I am trying to sell).

Ultimately, you may google "Pinto Alternator OEM Part 123456". The keywords that might be pertinent to you have covered over with a flood of useless words like Ferrari, Honda, Lamborghini, Mazda, bla bla bla. ZC never even scooped up the OEM part number, even though it is right there on the product description!

Similarly, my top level categories are NOT irrelevant to my site, only to a specific part that must be drilled down to find.

What I would REALLY like to do is rewrite that script to pick up top level categories and sub categories that lead to the product. But I am nowhere near smart enough to figure that out!

It is my opinion that I am pointing out a flaw that hurts all Zen Cart owners by hurting chances of climbing search engine ranks. It is a great idea to automate meta tagging and I absolutely love Zen! Just this one issue could use a bit more thought... a rewrite of the script that ONLY scoops up the relevant cat/sub cats (bread crumb).

That is my two cents!

Thanks for you help!

25 Feb 2012, 11:08 PM
#7
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

A simpler way to bypass its use would be to define the KEYWORDS constant in your /includes/languages/YOUR_TEMPLATE_NAME/meta_tags.php file. That would prevent the code you quoted from being able to add the categories to it at all.

If I do this, will ZC subsequently scoop up key words from the actual product description?

26 Feb 2012, 6:37 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

Feznizzle:

A simpler way to bypass its use would be to define the KEYWORDS constant in your /includes/languages/YOUR_TEMPLATE_NAME/meta_tags.php file. That would prevent the code you quoted from being able to add the categories to it at all.

If I do this, will ZC subsequently scoop up key words from the actual product description?
Yes, it would. And, this approach is actually safer than deleting the code you quoted earlier.
If you choose to delete the code, don't delete the "define" statement on the last line that you quoted.

Either approach will work. I'd lean towards putting the define into the language file instead.

Feznizzle:

If I delete this passage, will my ZC simply skip the top level categories when it automatically creates meta keywords? Again, I want the automated meta generation... I just want to skip the top level categories.
Yes, it will skip building data based on any category names.

.
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.

27 Feb 2012, 10:31 AM
#9
moosesoom avatar

moosesoom

New Zenner

Join Date:
Dec 2008
Location:
Rimini, Italy, Italy
Posts:
67
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

I'm trying to achieve a similar result.
I wanna try to duplicate breadcrumbs class in another class to output current product, or category, categories branch (removing "Home" that's unuseful for this feature).

So if I have these categories:

Clothing
     Pants
          Stone Washed
     Jackets
     Shirts
Equipment
     Lamps
     Ropes

the categories portion of automated meta tags would be (for example, in product "501 Jeans stone washed"):

Clothing, Pants, Stone Washed

and not the standard zen cart:

Clothing, Equipment

Now (I have no experience with classes) it seems to me, the new class has to be inserted in some auto_load thing....could you please point me to any documentation about that?

27 Feb 2012, 6:43 PM
#10
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Either approach will work. I'd lean towards putting the define into the language file instead.

Could not get it to work!

I could not find the specified file here:
/includes/languages/YOUR_TEMPLATE_NAME/meta_tags.php

But found it here:
/includes/languages/english/meta_tags.php

I copied it to here
/includes/languages/english/YOUR_TEMPLATE_NAME/meta_tags.php

I then found this code:
// Custom Keywords
define('CUSTOM_KEYWORDS', '');

And changed it to:
// Custom Keywords
define('CUSTOM_KEYWORDS', 'random,test,words');

There was no change whatsoever. What did I do wrong?

BTW, I also tested it by defining keywords before putting the file into an override folder. Made zero difference.

I also tried deleting that passage, the route you felt was less safe. When I did that, it killed the categories and grabbed the prod title for keywords. This was slightly better, but, due to grammar errors (words,are,supposed,to,have,commas,between), this is still not exceptable.

Contemplating disabling keywords entirely. The meta title/description can be manipulated satisfactorily. The SE's can do a good enough job at grabbing keywords, so maybe I should leave it be.

I found a conversation (one that included you) where this problem was discussed. At the end, apparently a good solution was had but not posted!

Here is the last page of that conversation, check out post #84:
http://www.zen-cart.com/forum/showthread.php?t=37195&page=9

27 Feb 2012, 8:13 PM
#11
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

Apologies for leaving out the "english" foldername. Sorry.

You missed what I told you: add a define for KEYWORDS to that file.

define('KEYWORDS', '');

.
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.

27 Feb 2012, 8:30 PM
#12
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

My bad! Thanks, that did indeed work to kill the automatic generation of key words based on top level categories, thanks!

But my ZC did not continue on and generate keywords based on the product description. It just stopped it right there after my defined keywords.

sigh

I guess I'm off to Odesk!

This is what I want done, in case anybody is interested... a script rewrite that will:
• Remove the automatic listing of top level categories
• Harvest keywords from my prod description
• Clean out garbage like symbols )&(#*
• Strip out useless words (the, a, and, of, for, etc)
• Remove spaces
• Add,commas,between,each,word
• Limit Title, Desc, and Keyword output to reasonable character counts

Thanks for your help, DrByte.

28 Feb 2012, 1:50 AM
#13
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

Feznizzle:

But my ZC did not continue on and generate keywords based on the product description. It just stopped it right there after my defined keywords.
Hmmm ... sounds like you introduced an error. If there were no other changes to core code, then the product-related stuff works just fine, assuming you're viewing a product page.

.
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.

29 Feb 2012, 10:04 AM
#14
moosesoom avatar

moosesoom

New Zenner

Join Date:
Dec 2008
Location:
Rimini, Italy, Italy
Posts:
67
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

I don't know if someone moved my post from this thread or if I simply wrote it in another forum room by mistake. It's about a similar solution involving a modified clone of breadcrumbs class.

Could you please check for it and give me some pointer to correctly code it?

My post is currently at http://www.zen-cart.com/forum/showthread.php?t=193074

29 Feb 2012, 12:45 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

The post was intentionally moved, because it's a different topic.

EDIT: Post has been moved back.

.
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.

29 Feb 2012, 1:51 PM
#16
moosesoom avatar

moosesoom

New Zenner

Join Date:
Dec 2008
Location:
Rimini, Italy, Italy
Posts:
67
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

DrByte:

The post was intentionally moved, because it's a different topic.

IMHO not so different because the breadcrumbs way was introduced and desired by Feznizzle in post #6 of this thread.

29 Feb 2012, 4:12 PM
#17
drbyte avatar

drbyte

Sensei

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

Re: How to auto generate just product keywords from product page?

Okay, so we differ in opinion. Breadcrumbs are handled by code that's entirely different from metatags code. So any solution to your unique wish will be a completely different answer than what was discussed in this thread.

.
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.

29 Feb 2012, 4:23 PM
#18
moosesoom avatar

moosesoom

New Zenner

Join Date:
Dec 2008
Location:
Rimini, Italy, Italy
Posts:
67
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Anyone knowing zen cart classes and autoloading for any pointer?

Thanks in advance

29 Feb 2012, 4:58 PM
#19
moosesoom avatar

moosesoom

New Zenner

Join Date:
Dec 2008
Location:
Rimini, Italy, Italy
Posts:
67
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

I'm sorry for insisting, but my idea was not just to use breadcrumbs, but a modified clone of breadcrumbs class (i.e., breadcrumbs class is just a starting point) to produce as output the branch of categories tree , with elements separated by commas, relative to a given category or a product, so to use it in meta-tags keywords building.

This is what Feznizzle desired at the start of the thread (but he has not programming knowledge to accomplish that). He said: > What I would REALLY like to do is rewrite that script to pick up top level categories and sub categories that lead to the product. But I am nowhere near smart enough to figure that out!

Sure we took two different ways, your advice is to eliminate top level categories from keywords, my way is to subsitute them with correct categories branch.

So the way I choose to follow is not your way for sure, but it's what user Feznizzle asked for...

I already created the new class, what I need is learning how to use classes in Zen Cart...that's why I wrote my initial (and following) post(s); could you please give me some pointer to that? Thanks

29 Feb 2012, 8:06 PM
#20
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How to auto generate just product keywords from product page?

Feznizzle:

I am, as a matter of mathematically provable fact, an SEO expert. Not to come off as cocky, just pointing out a truth. :cool:

Yes... there are perhaps 100 million SEO experts in the world today (tomorrow there will be 110 million)...

But if you are an "expert" why are you concerning yourself with meta keywords when ALL MAJOR SEARCH ENGINES completely ignore them, and have ignored them for the better part of 5 years?

:smartalec: (A real, true SEO expert)

20 years a Zencart User