Use Product Name as Meta Keywords in ISC

Problem

By default, the Meta Keywords tag in Product page is always empty unless you define the meta keywords manually for each product.

<meta name="keywords" content="" />

Solution

Use product name, brand, SKU for Meta Keywords tag automatically

In /public_html/includes/classes/class.product.php

Find

$this->_prodmetakeywords = $row['prodmetakeywords'];

Replace

//===========================
// MOD START
// Use product name as meta keywords
//===========================
//$this->_prodmetakeywords = $row['prodmetakeywords'];
$metakeywords = str_replace("(", "", trim($row['prodname'])); // remove (
$metakeywords = str_replace(")", "", $metakeywords); // remove )
$metakeywords = str_replace(" ", ",", $metakeywords); // replace space to ,
$metakeywords .= ",online,shop,free shipping,sale,discount,".$GLOBALS['StoreName'].",".$row['prodcode'];
if($row['prodbrandname'] != ''){
	$metakeywords = $row['prodbrandname'].",".$metakeywords;
}
$this->_prodmetakeywords .= "buy,best,new,$metakeywords,".$row['prodmetakeywords'];
// MOD END
//===========================

Result

<meta name="keywords" content="buy,best,new,modDIY,90,Degree,Angled,USB,3.0,20,Pin,Internal,Header,Mini,Connector,Black,online,shop,free shipping,sale,discount,modDIY.com,CO1054" />

Leave a Reply

Your email address will not be published. Required fields are marked *