Yoast SEO Adding Website Name to the Title

Yoast SEO is adding my website name to the end of the Title of every page and categories. Posts are working perfectly. I’ve tried with Force rewrite title enabled and disabled and still the same.

According to the Yoast documentation it says the Title should only look like this:

Read More
<title><?php wp_title(''); ?></title>

Mine currently looks like this:

<title> <?php wp_title("|",true, 'right'); ?> <?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ?></title>

The documentation also says

You should check whether a constant named WPSEO_VERSION is defined,
preferably like this:

if ( defined('WPSEO_VERSION') ) {
// Disable your SEO stuff
}

Because of WPSEO_VERSION I’m a little confused. Should I remove my current title code and replace it with the one recommended by Yoast even if it means deleting the WPSEO_VERSION line?

Related posts