Better page title with and without Yoast WordPress SEO plugin

VN:F [1.9.22_1171]
Rating: 4.0/5 (2 votes cast)

Look like Yoast‘s comments are breaking code, so I’ll put it here.

If You are using (and You should!) Yoast’s WordPress SEO plugin, it’s good to backup Your WordPress theme with fall-back solution, if some day client will deactivate WordPress SEO plugin.

My solution: (original)

<title>
<?php if (!defined('WPSEO_VERSION')) {
// if there is no WordPress SEO plugin activated
wp_title(' | ', true, 'right'); ?><?php bloginfo('name'); ?>
| <?php bloginfo('description'); // or some WordPress default
}else {
// WordPress SEO plugin active
wp_title();
} ?>
</title>

Adopted:

VN:F [1.9.22_1171]
Rating: 4.0/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
Better page title with and without Yoast WordPress SEO plugin, 4.0 out of 5 based on 2 ratings

Look! Already 3 responses to Better page title with and without Yoast WordPress SEO plugin

akhil

#26

Ok, where should i put this code in my site?

Rolands Umbrovskis

#27

in header.php where tags are

akhil

#28

Thanks buddy….

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>