Hi. I am using the_excerpt as the meta description for my page. Unfortunately, adding back HTML formatting using Advanced Excerpt is causing my meta description to break and print out at the top of the page.
This is the code in my page header to use the excerpt as meta description and tags as keywords:
<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php csv_tags(); ?>
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<meta name="keywords" content="plastic-free, less plastic, no plastic, living without plastic, Beth Terry, collecting plastic, plastic tally, reduce, reuse, recycle, environment, ecology, green, sustainable, zero waste, garbage, plastic bags, plastic bottles, pollution" />
<?php endif; ?>
Is there something else I can try in order to keep some formatting in my excerpts on the homepage but strip out formatting for excerpts in the meta description?