Ranking in search is only half the battle. To obtain all the potential traffic, you need to know how to write meta descriptions that make your listings stand out and appeal to searchers. Unique meta descriptions help ensure that the search results contain a relevant hook to encourage the searchers to click through. Search engines may also use the meta descriptions and titles of pages to perform a quick check to see if pages are duplicates of one another. Having lots of pages with duplicate meta descriptions can hurt marketing and may also hurt the indexing and ranking of the pages. While it is best to custom craft meta descriptions by hand, this is not always possible. We recommend having a method in place to generate meta descriptions automatically when then webmaster has not written them. Google in particular takes the meta description tag as a recommendation. If Google feels that other text on the page would be a better description for the search results, Google will disregard the meta description and use that other text instead.
Large sites should usually generate meta descriptions automatically because the time to write a meta description for all the pages could be excessive. When an eCommerce site has hundreds or thousands of dynamically generated pages, it often makes sense to dynamically generate meta descriptions. Sometimes the best way to create a meta description is to create a template and perform substitution, such as:
You would use the appropriate syntax and variables for your CMS to replace {ProductName} and {PartNumber} with dynamic values.
When this simple approach results in unappealing or redundant meta descriptions, or just can’t be implemented easily, a more sophisticated approach is to use the content of the page to create the meta description.
Code Sample
The following PHP code takes a text field, such as a product description, as input and generates an excerpt that will serve as a good meta description. Use that excerpt as the ‘content’ attribute value in the meta description tag.