0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

How to Prevent Duplicate Content

Unless you’re using excerpts for non-single page views, your post content is being displayed in your single pages, date-based archives, category archive, tags archives, author archives, and so on. From an SEO perspective, this “duplicate” content may be detrimental to your search-engine rankings.

To prevent duplicate content, we can conditionally display one of two <meta> tags depending on the type of page being displayed. Pages that we want to have indexed in the search engines will display a “meta-index” tag, while duplicate pages will display a “meta-noindex” tag.

To do this, simply add the following code to the <head> section of your theme’s header.php file:

<?php if ((is_home() && ($paged < 2 )) || is_single() || is_page() || is_category()) {
	echo '<meta name="robots" content="index,archive,follow" />';
} else {
	echo '<meta name="robots" content="noindex,noarchive,follow" />';
}

Once in place, this code effectively stops search engines from indexing all types of pages except for single-post, page-page, category-archive, and the first two index pages. These are considered by many to be the most effective pages to have indexed, but feel free to add or remove anything you see fit to customize the technique.

Source: Perishable Press




0