Sunday, June 14, 2015

Customizing SEO Title in WCS


WCS is using SEOPAGEDEFDESC table for maintaining the SEO related attributes such as meta tile, description and keywords. Google crawlers are using the values in meta description and keyword fields while calculating the ranking. Hence it is important to have meaningful & product/category specific values to be generated in each of the pages displayed to the user.

We can either insert values corresponding to each category and product pages in this table or we can insert substitution parameters defined by WCS, which will get evaluated during runtime. There is a pre-defined set of substitution parameters defined by WCS, a few them can be used only in category pages and others in product pages. For eg: <seo:productShortDescription> can be used only in product details pages.

By default, the SEOPAGEDEFDESC table will be populated with the substitution parameters defined by WCS.

There can be situations, where business want us to configure a different set of title and meta description by providing a template, which is applicable to all products/categories. This can be done by using a script/stored procedure to generate meta title and keyword for each product/category based on the template and insert it into the above table. In this case, there will be an entry in  SEOPAGEDEFDESC against each and every product/category. Each time, a new product gets added to WCS, this activity should happen.

Another option to handle this situation is by creating new substitution parameters. This can be done by inserting a new substitution parameter name in SEOPAGEDEFSUBPARAM table. Insert an entry in CMDREG table to override the default implementation class used for substitution parameter.

INSERT INTO CMDREG (storeent_id,interface,classname) VALUES (0, 'com.ibm.commerce.seo.pagedefinition.commands.ProcessSEOSubstitutionParameterCmd', 'com.test.commerce.CustomSubstitutionCmdImpl')

The business logic to generate meta title and description as per the template provided needs to be written in the CustomSubstitutionCmdImpl.









1 comment: