Just show the excerpt for Meta Description
Here’s a quick script if you want to just display the excerpt for the meta description. I’m using the All In One SEO plugin, which can automatically generate the meta description, but it will use the entire content as opposed to the excerpt. If you’re using a plugin like Smart Youtube this can be a problem. It’s tempting to just add a meta description tag using the_excerpt within the loop on a single page, but that wouldn’t validate, so add this to your header instead. Enjoy!
<?php if (is_single()):while(have_posts()):the_post();
echo ‘<meta name=”description” content=”‘;
$out_excerpt = str_replace(array(”\r\n”, “\r”, “\n”), “”, get_the_excerpt());
echo apply_filters(’the_excerpt_rss’, $out_excerpt);
echo ‘” />’;
endwhile;
endif;
?>
Thanks to Michele for the snippet
Tags: description, excerpt, header, meta
Monday, November 16th, 2009 | SEO | Comments RSS | Respond | Trackback

……
Бизнесмен из Вас отличный…
Привет!! carlos@onlylcd.ru” rel=”nofollow”>……
С уважением,…
Pillspot.org. Canadian Health&Care.Special Internet Prices(up to 40% off average US price).No prescription online pharmacy.PillSpot.org. Vitamins@buy.online” rel=”nofollow”>.…
Categories: Eye Care.Mental Health/Epilepsy.Vitamins/Herbal Supplements.Antidiabetic.Antidepressants.General Health.Stop SmokingCholesterol.Womens Health.Anti-allergic/Asthma.Mens Health.Stomach.Pain Relief.Anxiety/Sleep Aid.Skin Care.Antiviral.We…