WordPress.org

Support

Support » How-To and Troubleshooting » Meta Tag Description problem

Meta Tag Description problem

  • I’m having a problem on Single Post, can you guys help me what to put on the meta description? I need to put an excerpt, am I doing it right?
    I wanted the excerpt to appear on google search engine. how can I do that manually? I already fixed my SEO so it will crawl it. I wonder if my meta description is my prob coz whenever I search my own post on google, it gives me the description of my index page, not the single post’s description

    <?php if ( is_single() )  { ?>
    		<meta name="description" content="<?php the_excerpt(); ?>">
    
    	<?php }
    	else
    		//do nothing
    	?>

    don’t mind my if else statement, am asking about the meta tag description.

Viewing 1 replies (of 1 total)
  • This is a code snippet I’ve used before that works good:

    <?php
    if (is_singular()):
    global $post;
    setup_postdata($post);
    ?>
    <meta name=”description” content=”<?php the_excerpt_rss(); ?>” />
    <?php endif; ?>

    But I’d recommend using an SEO plugin to handle things like this, since they’ll do a better job and do a lot more then just add meta descriptions. My favorite is WordPress SEO by Yoast.

Viewing 1 replies (of 1 total)
  • The topic ‘Meta Tag Description problem’ is closed to new replies.