|

Disable Automatic Filling of Meta Description Tag
Posted 26 December 2009 - 10:59 AM #1
Also, by default, there are no words containing 3 or less characters in meta description content. It looks especially ridiculous if the product is e.g. U2 CD or DVD.
I tried to edit meta.tpl file and changed:
<meta name="description" content="{$meta_description|default:$lang.home_meta_description}" />
to:
<meta name="description" content="" />
or
<meta name="description" content="{$meta_description}" />
but there is no change. Any advice?!
Posted 18 March 2012 - 09:56 AM #2
this is still on. I checked it on 2.2.4 and it still cuts out words under 3 letters.
I found something on core/fn.common.php about line 3030 or 3124 (depending your version)
it goes like
function fn_generate_meta_description($html, $max_words = 60)
Under that there's an if with this inside
if (fn_strlen($v) > 3) { $meta[] = $v; }
This indicates what should happen with words under 3 letters, took it away but still getting the same results.
Any Ideas how to fix that?
Posted 18 March 2012 - 01:22 PM #4
I will check this out .
-----------------------------------------------------------------------
Well its not in the db but I changed the value 3 to 0 instead of removing the whole "if" and it worked Fine!!!
I have now automated meta descriptions the right way.
Please Cs-Cart support fix that in the new version. If there should be a limit for words smaller than 3 words, it should be in the meta keywords, which they are not automated in cs-cart anyway...
Meta Description is a major Seo factor, and when people forget to put meta descriptions they get horrible meta descsriptions from the system
Fotis
Edited by dvsgr, 18 March 2012 - 01:36 PM.
Posted 24 March 2012 - 11:49 PM #5
yes i did, maybe it saves those values in the db.
I will check this out .
-----------------------------------------------------------------------
Well its not in the db but I changed the value 3 to 0 instead of removing the whole "if" and it worked Fine!!!
I have now automated meta descriptions the right way.
Please Cs-Cart support fix that in the new version. If there should be a limit for words smaller than 3 words, it should be in the meta keywords, which they are not automated in cs-cart anyway...
Meta Description is a major Seo factor, and when people forget to put meta descriptions they get horrible meta descsriptions from the system
Fotis
Thanks for this! Awesome!
Posted 25 March 2012 - 04:03 PM #6
I also post that in Bug Tracker.
It is under review.
Posted 16 September 2012 - 04:46 PM #7
The second issue for automatic meta descriptions are the double quote """. Google will cut off the meta descriptions if it found double quote characters inside the description. Indeed, it's easy to overcome the issue. Replace '"' with '"' will get the problem fixed.
Lastly, I personally deem that we should keep the characters '.' and ','.
CS-Cart Engineers, please fix them in the future releases if possible. Thanks!
Professional IT Services across Montreal Island QC, Computer and Electronics Online Sales - Great Deals
Posted 24 September 2012 - 02:29 PM #8
retail site ver. 2.1.1
Posted 19 December 2013 - 10:26 PM #9
/core/fn.common.php ~ line 2340
/controllers/customer/products.php ~ line 84
In fn.common.php I had to modify this function "fn_generate_meta_description" to have it return false instead of generating a description based of the product description.
function fn_generate_meta_description($html, $max_words = 60) { // Disable this function to auto-generate the meta_description return false; }
In products.php I disabled a fallback else statement that would generate the description and keywords based off the products category if the product had empty values for meta description or keywords.
if (!empty($product['meta_description']) || !empty($product['meta_keywords'])) { $view->assign('meta_description', $product['meta_description']); $view->assign('meta_keywords', $product['meta_keywords']); } // Disable auto-fill meta tags // else { // $meta_tags = db_get_row("SELECT meta_description, meta_keywords FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $_SESSION['current_category_id'], CART_LANGUAGE); // if (!empty($meta_tags)) { // $view->assign('meta_description', $meta_tags['meta_description']); // $view->assign('meta_keywords', $meta_tags['meta_keywords']); // } // }
Also modified the meta.tpl file.
/skins/basic/customer/meta.tpl
<meta http-equiv="Content-Type" content="text/html; charset={$smarty.const.CHARSET}" /> <meta http-equiv="Content-Language" content="{$smarty.const.CART_LANGUAGE|lower}" /> {if $controller == "index"} <meta name="description" content="{$meta_description|default:$lang.home_meta_description}" /> <meta name="keywords" content="{$meta_keywords|default:$lang.home_meta_keywords}" /> {else} {if $meta_description != ""} <meta name="description" content="{$meta_description}" /> {/if} {if $meta_keywords != ""} <meta name="keywords" content="{$meta_keywords}" /> {/if} {/if}
This was on the old 2.0.12 version of the cart but just thought I'd share what I had to do to make it not auto-generate the meta tags.