Customize meta description in wordpress theme

Customize meta description in wordpress theme

wordpress tutorial for, Customize meta description in wordpress theme. In article we will tell you trick to fetch traffic using Meta tags in wordpres theme.

Customize meta description in wordpress theme

Customize meta description in wordpress theme
Customize meta description in wordpress theme

we can do using the META description tag.  We can actually control what gets displayed in our little spot.
gaining the tremendous opportunity to convert that space into traffic with wordpress websites.

Search Engines, like Google, tend to display search results in a very standard format.  Usually the TITLE of the post or page is the link that actually takes you to the post, and under that link is a description of the site linked to.

Normally we write the Meta tags in wordpress theme as follows:


<meta name="description" content="Your site Description goes here" />

Instead of this use following code in your wordpress theme.


<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php endwhile; endif; else : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>

With adding this lines of code in your header.php file. you will be done.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

3 thoughts on “Customize meta description in wordpress theme”

Leave a Reply

Your email address will not be published.