coreyweb

  • Archive
  • RSS
  • Ask me anything

Avoiding Duplicate Titles in WordPress Media Attachments

Looking through Google Webmaster tools, I discovered a warning about duplicate title tags coming from WordPress media attachment pages, like this one.

Here is a quick fix (place inside the

of header.php:
<?php if ( is_attachment() ) { ?>
  <meta name="robots" content="noindex, nofollow" />
<?php } ?>

You can also adjust your title tag, to include some sort of prefix, like this:

<title>
  <?php if ( is_attachment() ) { ?>Attachment: <?php } ?>
  <!-- include your normal title stuff here -->
</title>
    • #wordpress
    • #SEO
    • #code
  • 5 months ago
  • 10
  • Permalink
  • Share
    Tweet

10 Notes/ Hide

  1. coreyweb posted this
← Previous • Next →

Portrait/Logo

About

a stream of random thoughts, ideas, links & a few hard-to-classify posts

corey brown (aka coreyweb) is the COO/cofounder of Squidoo founder of No Treble, Bright Cowork and Refresh Winchester, plus husband, dad, bassist and instigator.

Elsewhere on the web

  • @coreyweb on Twitter
  • Facebook Profile
  • coreyweb on Flickr
  • coreyweb on Delicious
  • Google
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr