Better page title with and without Yoast WordPress SEO plugin

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:

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 *