Content last modified Monday 6 March 2017
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 3 Yes
  • 7 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!



Providing the “description” meta tag is widely known as a good SEO practice. On top of that, it helps differentiate site’s pages, which prevents search engines from seeing them as duplicated content. It becomes then especially useful in a very special case of blogs. This plugin generates such a meta tag basing on the first words of the article, ending the quotation with horizontal ellipsis (…).


The plugin provides the <txp:art_meta_description /> tag that should be placed in the <head> of the page.

The plugin is designed to work on articles (where adding the “description” meta tag is virtually useful). Thus, there is no use of placing it on the pages that do not show single articles. However, the plugin won’t do any harm in that case – it will simply output nothing.

A few options are available to allow user to customise the plugin.


determines how many words are used to generate the tag. The default value is 25.


determines the maximum number of characters (including the ellipsis) in the content of the generated tag. It is important because of search engines limits (too long descriptions could be banned). If the text that consist denoted number of words is too long, it is being automatically shortened to fit in allowed number of characters. The default value is 250.


allows to use the content of the article body instead of the excerpt, which is the default behaviour. Nevertheless, if the article excerpt turns out to be empty, the article body will be used, so there is no need to use this option if the excerpt is not present. The defalut value is false

Example usage

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     <txp:art_meta_description words="20" maxchars="150" prefercontent="true" />
     <!-- the rest of the head goes here -->

The above example shows heavily customised usage of the tag. The plugin will take first 20 words of the article body (but not more than 150 characters).

End notes

The plugin is designed with Unicode support in mind, but it was tested only with Polish texts. All reports concerning other languages, as well as bugs and feature requests are very welcome.

Article Request Count:

Archived [?]: orphaned: broken links

Initially released:
Posted here:
19 Aug 2006
Article modified:
09 Apr 2008

Comments/questions? Leave a message in the form.

Commenting is closed for this article.

Commented (2)

Nice, someone did it finally.

Another way to get a page dependant meta-description with standard tags is shown here:

Trick: Textpattern with page dependent header meta description

The main advantage is the fully customizable support for the content. I am using article title, article keywords plus some short pre-defined words.

Related is the article with the flashy but very true title: Header titles optimize AdSense output

It’s ouputing broken html from the body in my descriptions

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern