You are here:  » Meta DESC & Keywords

Support Forum



Meta DESC & Keywords

Submitted by magickid on Mon, 2011-11-28 17:02 in

Hiya

Im looking for some ideas on how to get better SEO on this script.

Like:

Meta description and meta keywords for the Home page.
Meta description and meta keywords for product pages, brand and category pages, using some of the variables already in the script.

Thanks :)

Submitted by support on Mon, 2011-11-28 18:25

Hi,

In the distribution, the product page meta keywords and description tags are set by the following code beginning at line 66 in products.php:

      $header["meta"]["description"] = translate("Price search results for")." ".htmlentities($q,ENT_QUOTES,$config_charset);
      $header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);

At this point; all fields in the main product record are in scope in $product["products"][0].

So for example; if you wanted to make the keywords meta tag comprise product name (which is in $q anyway) together with the category and brand comma separated with it; you could REPLACE:

      $header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);

with:

      $header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);
      if ($product["products"][0]["category"]) $header["meta"]["keywords"] .= htmlentities($product["products"][0]["category"],ENT_QUOTES,$config_charset);
      if ($product["products"][0]["brand"]) $header["meta"]["keywords"] .= htmlentities($product["products"][0]["brand"],ENT_QUOTES,$config_charset);

If you're not sure what code to use to achieve the tag content you require, perhaps if you could post an example of your ideal tag content i'll work out the PHP code similar to the above for you...

Cheers,
David.
--
PriceTapestry.com