A canonical URL is an HTML code installed on a website between <head> </head> to inform Google's search engine of a valid URL to avoid duplicate URLs with the same content. For example, a website page can be accessed from 2 different URLs with the same website page (domain.com/?p=products and domain.com/products). Google will choose one canonical URL as a valid link.