WordPress Categories Causing Duplicate Content
Today I discovered wordpress categories causing duplicate content while I was playing with the wordpress category base. I was tweaking settings on my wordpress blog and stumbled across something interesting that took my attention for the next hour. I’m sure, others may have discovered this content duplication issue earlier.
I have always wanted to use the category feature in order to produce a Silo Design on my wordpress blog/website. A proper category structure always helps ranking better on search engines. Rather than posting all posts on the top level, it is better to have URLs displaying posts in proper categories.
Recently, I searched around to find a solution to remove the ‘category’ from my category page URLs, however, I was unsuccessful in finding any help. One reason why I wish to remove ‘category’ from my URLs is that I want to have better looking Category Page URLs. For eg:
http://www.devduff.com/internet instead of .. http://www.devduff.com/category/internet
WordPress by default set the category base to display ‘category’ in the URLs. And this is the reason why there is heavy content duplication on Category Pages. Have you ever checked these two URLs?
http://www.yourblog.com/category/somecategory and .. http://www.yourblog.com/somecategory
You will be amazed to find that both these URLs open the same document. Bingo! Content Duplication. There is a fine way for overcoming this problem. Redirection through .htaccess is your best bet. All you need to do is add a line of code to your .htaccess and avoid this un-necessary content duplication. I’m pasting my .htaccess content below to make it easy for you to tweak your .htaccess file.
Options +FollowSymLinksRewriteEngine On RewriteRule ^category/(.+)$ http://www.devduff.com/$1 [R=301,L] RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
You would have almost same content in your .htaccess file, unless you have added anything to it manually. I have just added one line to it:
RewriteRule ^category/(.+)$ http://www.devduff.com/$1 [R=301,L]
This line will redirect permanently all requests from URL: http://www.devduff.com/category/somecategory to the URL: http://www.devduff.com/somecategory. This is definitely going to resolve wordpress categories duplicate content issue.
If you have any better tips to resolve the ‘wordpress category’ issue, please feel free to post a comment below. You can explore other wordpress tutorials that may interest you or help you in one way or the other.
Thankyou for reading this article!
Tags: Wordpress Tutorials




What do you think about this article?