{"id":20659,"date":"2020-11-30T04:44:46","date_gmt":"2020-11-29T20:44:46","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&p=20659"},"modified":"2023-01-18T10:07:43","modified_gmt":"2023-01-18T02:07:43","slug":"what-is-a-canonical-tag","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/what-is-a-canonical-tag","title":{"rendered":"What is a Canonical tag?"},"content":{"rendered":"\t\t
A canonical tag is an HTML tag used to show the search engines that similar URLs are actually the very same page. The canonical tag is then added to pages using a link element in the HEAD of the HTML document.<\/p>
If two URLs contain the same canonical tag. This indicates to search engines to index the pages as a single entry.<\/p>
For example, take the following URLs:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
Technically, these are the same exact place. It means that they all pull up our KB home page despite having different URLs. To Google and other search engines, these all would be indexed and crawled as individual pages, even though they\u2019re all the same exact content.<\/p>
Enter the Canonical tag!<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
Using the canonical tag,\u00a0we can show\u00a0to search engines\u00a0that all these different URLs serve the same resources or page. Continuing with our example the canonical page used would look like:<\/p>
With this Meta tag included in our documents HEAD, then we should see all of the example URLs indexing as the same page.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t You should use canonical tags whenever serving the same content from multiple URLs. The affected URL variations include changes to protocol (http vs https), query parameters, and (of course) URL structure. Implementing Canonical tags is especially useful when serving the same content over various URLs. Usually, we call it the \u201cDuplicate Content\u201d problem when looking into a website’s SEO performance.<\/p> Additionally, in the case of URLs with query parameters, it helps ensure that search engines only index a page with the \u201ccleanest\u201d form of the page’s URL. This helps to prevent indexing the pages with query parameters separately from your main page.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t If you are familiar with the SEO topic, you will understand how important it can be to redirect your URLs properly. So you might be wondering, \u201cWhy not just redirect these pages?\u201d. That\u2019s a great question! If you ever have the option you should always add a redirect. Think of canonical tags as a way of clearing up a potential ambiguity (if the same content is visible on two pages), whereas a 301 redirect removes any potential ambiguity. That said, basically, you should always aim to include Canonical tags. This is because they help cover URL variations based on query parameters as well.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/code><\/p><\/code><\/p>Why should I use Canonical tags?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
To 301 redirect, or to Canonical; that is the question.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t