{"id":233,"date":"2009-02-16T23:58:53","date_gmt":"2009-02-16T18:28:53","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/?p=233"},"modified":"2009-02-16T23:58:53","modified_gmt":"2009-02-16T18:28:53","slug":"avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2009\/02\/avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin\/","title":{"rendered":"Avoid Duplicate Content &#8211; Use Canonical URL in WordPress"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/10\/wordpress_logo-1-1.png\" alt=\"WordPress Logo\" title=\"WordPress Logo\" width=\"183\" height=\"145\" class=\"alignnone size-full wp-image-136 intro\" align=\"right\" \/><\/p>\n<p class=\"intro\">The new talk of the SEO world is &#8216;<a href=\"http:\/\/googlewebmastercentral.blogspot.com\/2009\/02\/specify-your-canonical.html\">Canonical URL<\/a>&#8216;. What is canonical URL? This is the definition given in Google&#8217;s Webmaster Central Blog&#8230;<\/p>\n<blockquote>\n<p>a format that allows you to <strong class=\"highlight\">publicly specify your preferred version of a URL<\/strong>. If your site has identical or vastly similar content that&#8217;s accessible through multiple URLs, this format provides you with more control over the URL returned in search results. It also helps to make sure that properties such as link popularity are consolidated to your preferred version.<\/p>\n<p>Emphasis mine<\/p>\n<\/blockquote>\n<p>It is very easy to specify the canonical URL of a page &#8211; all you have to do is <strong class=\"highlight\">add this line in the head section<\/strong>&#8230;<\/p>\n<pre><code class=\"html\">&lt;link rel=\"canonical\" href=\"http:\/\/binnyva.com\/\" \/&gt;<\/code><\/pre>\n<p>The purpose of this tag is to <a href=\"http:\/\/www.dailyseoblog.com\/2009\/02\/duplicate-content-canonical-tag-to-your-rescue\/\">prevent the problem of duplicate content<\/a>.<\/p>\n<p>The best thing about this tag is that all three major search engines(<a href=\"http:\/\/googlewebmastercentral.blogspot.com\/2009\/02\/specify-your-canonical.html\">Google<\/a>, <a href=\"http:\/\/ysearchblog.com\/2009\/02\/12\/fighting-duplication-adding-more-arrows-to-your-quiver\/\">Yahoo<\/a> and <a href=\"http:\/\/blogs.msdn.com\/webmaster\/archive\/2009\/02\/12\/partnering-to-help-solve-duplicate-content-issues.aspx\">MS Live<\/a>) support this initiative.<\/p>\n<h2>WordPress<\/h2>\n<p>If you are on wordpress, this tag can be integrated into your theme easily. <a href=\"http:\/\/yoast.com\/wordpress\/canonical\/\">There is a plugin<\/a> to do the job for you &#8211; but you don&#8217;t need a plugin to do something as simple as this.<\/p>\n<h3>header.php<\/h3>\n<p>Go to the <strong class=\"highlight\">theme folder<\/strong> in wordpress(wp-content\/themes\/&lt;theme_name&gt;) and <strong class=\"highlight\">open the file <code>header.php<\/code><\/strong> in your favorite editor. Now <strong class=\"highlight\">find the line<\/strong>&#8230;<\/p>\n<pre><code class=\"html\">&lt;\/head&gt;<\/code><\/pre>\n<p>and add the following code <strong class=\"highlight\">before<\/strong> that line&#8230;<\/p>\n<pre><code class=\"html\">&lt;?php if ( is_singular() ) { ?&gt;\n&lt;link rel=\"canonical\" href=\"&lt;?php the_permalink(); ?&gt;\" \/&gt; \n&lt;?php } ?&gt;<\/code><\/pre>\n<p>Now, it should look something like this&#8230;<\/p>\n<pre><code class=\"html\">&lt;?php if ( is_singular() ) { ?&gt;\n&lt;link rel=\"canonical\" href=\"&lt;?php the_permalink(); ?&gt;\" \/&gt; \n&lt;?php } ?&gt;\n&lt;\/head&gt;<\/code><\/pre>\n<p>That&#8217;s it &#8211; you are done! <strong class=\"highlight\">Save the file and upload it<\/strong> to your server.<\/p>\n<p>This fix will add the canonical URL tag to all the posts and pages of your blog. If you want to see a blog that have implemented this fix, take a look at the source of this page.<\/p>\n<h2>Related Links<\/h2>\n<ul>\n<li><a href=\"http:\/\/www.seobuzzbox.com\/what-is-a-canonical-url\/\">Canonical URL<\/a><\/li>\n<li><a href=\"http:\/\/mrjavo.com\/what-is-a-canonical-url\/\">What Is A Canonical URL?<\/a><\/li>\n<li><a href=\"http:\/\/ifacethoughts.net\/2009\/02\/14\/canonical-urls-to-avoid-duplicate-content\/\">Canonical URLs To Avoid Duplicate Content<\/a><\/li>\n<li><a href=\"http:\/\/www.mattcutts.com\/blog\/canonical-link-tag\/\">Learn about the Canonical Link Element in 5 minutes<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>The new talk of the SEO world is &#8216;<a href=\"http:\/\/googlewebmastercentral.blogspot.com\/2009\/02\/specify-your-canonical.html\">Canonical URL<\/a>&#8216;. What is canonical URL? This is the definition given in Google&#8217;s Webmaster Central Blog&#8230;<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,14,26,30,31],"tags":[62,72,80,117,250,279,293,304],"class_list":["post-233","post","type-post","status-publish","format-standard","hentry","category-blogging","category-google","category-seo","category-web-development","category-wordpress","tag-blog","tag-canonical","tag-code","tag-fix","tag-seo","tag-theme","tag-url","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}