logo logo

WordPress: Using the_excerpt as the Description

Tthe description element is another part of HTML that has uses with search engines. Well designed websites use the description element not only for keywords and a simple description of the page, but also it can control how the page shows up in search engines (once again, a better explanation of this can be found in the Googlebot Meta Tags post )

For WordPress users, there are various plugins that can be used. Another way to control the description of a post is to alter the header.php of the theme to use the_excerpt for the description.

The following is the code that would produce this:

<meta name="description" content="<?php the_excerpt() ?>" />
bottom

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution. Please understand with hundreds of SPAM comments, it takes a while to sort through to approve the good comments. Sometimes, by accident, some good comments accidentally get marked as spam. Please let us know if your comment did not get posted. Also, if your comment has a link to it or anything else in it that would make it seem like spam, it will be deleted. So please post a real comment and not one that is only made to link to a site only. Otherwise, it could get deleted.

bottom bottom bottom