Fixing duplication in HTML title element for WordPress with Yoast SEO installed

I was having a problem in WordPress for my blog where the title contained duplicate values, like “John’s blogJohn’s blog”.

The fix for me was to edit wp-content/themes/twentyeleven/header.php and disable a bit of the output, as shown below. I basically just added an if ( false ) to disable the code which caused the duplicate content.

This seems to effectively mean that Yoast SEO is in charge of the titles now. You can configure separately the homepage, posts, and pages titles in the Yoast SEO settings. I configure mine in Yoast SEO Settings / Content Types like this:

Homepage
Site title Separator Tagline
Posts
Title Separator Site title
Pages
Title Separator Site title
<title>
<?php
  // Print the <title> tag based on what is being viewed.
  global $page, $paged;

  wp_title( '|', true, 'right' );

// 2024-07-14 jj5 - OLD: I removed this because wp_title() (above) does everything that needs to be done.
if ( false ) {
  // Add the site name.
  bloginfo( 'name' );

  // Add the site description for the home/front page.
  $site_description = get_bloginfo( 'description', 'display' );
  if ( $site_description && ( is_home() || is_front_page() ) ) {
    echo " | $site_description";
  }

  // Add a page number if necessary:
  if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
    /* translators: %s: Page number. */
    echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) );
  }
}
?>
</title>

Super gluing number pad holder together

Over time the joint on this holder comes a bit loose and I have to tighten it back up again. This time when I tightened it I dumped a whole tube of superglue in there. Hopefully that holds it!

I do put it under quite a bit of strain. In addition to holding the number pad for the booth, it also holds a bunch of my cables which I hang over it.

That red tape you can see I put there to stop the glue from leaking too much. I will remove that once the glue is dry.

A photo of the arm which holds the number pad to the table