How to avoid the same meta description on Tag archives with Thesis theme

Olsen Twins

by Tiziano on January 27, 2010

in WordPress Optimization

Thesis is a great theme for WordPress (this blog uses it :) ) but I don’t like the way it handles the meta tag description on all the Tag archive pages. In fact, Thesis repeats the blog descrption on all these pages.

In order to avoid this, you have to edit the file \lib\classes\head.php (around line 104) of your Thesis theme.

You have to change it from:

elseif (is_category()) {
				$category_description = trim(strip_tags(stripslashes(category_description())));
				$meta['description'] = (strlen($category_description)) ? '<meta name="description" content="' . $category_description . '" />' : '<meta name="description" content="' . single_cat_title('', false) . '" />';
			}

to:

elseif (is_category()) {
				$category_description = trim(strip_tags(stripslashes(category_description())));
				$meta['description'] = (strlen($category_description)) ? '<meta name="description" content="' . $category_description . '" />' : '<meta name="description" content="' . single_cat_title('', false) . '" />';
			}
elseif (is_tag()) {
				$meta['description'] = '';
			}

This code will remove the meta tag description on every tag archive page. Because it’s better to remove it than have the same description on all pages.

Let me know your impression about it.

Comments on this entry are closed.

Previous post:

Next post: