WordPress – How to display the tag descriptions as meta descriptions?

Published on July 27, 2016 , under Wordpress
Love It! Love It 4


Wordpress

Meta descriptions are may be or may not be useful for SEO, that is a issue of debate but one thing for sure that they are important as they tell search engines about concise explanations of the contents of web pages. There are various ways to add Meta descriptions on your wordpress blog, one can use any SEO plugin or add some code in header.php file to get appropriate meta descriptions. In case you don’t wanna add plugin here is a trick to generate custom meta descriptions on tags pages of your wordpress blog.

First of all open theme editor copy header.php file and remove <?php get_header(); ?> from tags.php and paste the coding you copied form header.php file in place of of <?php get_header(); ?>.
Search for Html title tag <title></title>, paste the following code below it.

<?php if ( is_tag() && tag_description() ) : ?>
<meta name=”description” content=”<?php echo trim(strip_tags(tag_description())); ?>”/>
<?php endif; ?>

Now whenever you add description of any tag, it will appear on your web page as description

Sponsored Links

Related Posts

No related photos.

Comments

One Response to “WordPress – How to display the tag descriptions as meta descriptions?”
  1. glenda says:

    confused angry hurt disappointed betrayed, emathetic drowninging, strugglinging maintaining. desescalting

Speak Your Mind



Speak your mind