Prevent dublicate content with conditional noindex

If you handle SEO factors by yourself and not using any seo plugins we found a great snippet for the noindexindex issue. This is a pretty smart solution which takes advantage of conditional tags. The code needs to be placed in your header’s meta section.
In this example it tells the search engines robots to only index and follow the frontpage (no archives), single posts, pages and categories. In this example tags and CPT posts (is_singular(‘movies’)) will have “noindex, follow”. You do have perfect influence which sites you want to be indexed. There is a conditional tag for nearly everything for your perfect SEO strategy to avoid dublicate content.

/**
 * Snippet Name: Prevent dublicate content with conditional noindex
 * Snippet URL: https://www.wpcustoms.net/snippets/prevent-dublicate-content-conditional-noindex/
 */
  if ((is_home() && ($paged ';
} else {
    echo '';
} 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x