Mobile app version of vmapp.org
Login or Join
Pope3001725

: How to use a canonical link tag in a static page? What is canonical linking and how can I use it in a static site? How do we use canonical linking? Suppose we have two pages page1.html

@Pope3001725

Posted in: #Html #Url

What is canonical linking and how can I use it in a static site?

How do we use canonical linking? Suppose we have two pages page1.html and page2.html, I want to canonical linking for page2. Where should we write the canonical link tags?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pope3001725

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

You need to add the canonical links within the element <head> and you will find this at the top of your HTML document. You will find this information all on Google Webmasters:


Indicate the preferred URL with the rel="canonical" link element

Suppose you want blog.example.com/dresses/green-dresses-are-awesome/ to be the preferred URL, even though a variety of URLs can access this content. You can indicate this to search engines as follows:


Mark up the canonical page and any other variants with a rel="canonical" link element. Add a <link> element with the attribute rel="canonical" to the section of these pages:
<link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />


This indicates the preferred URL to use to access the green dress post, so that the search results will be more likely to show users that URL structure. (Note: We attempt to respect this, but cannot guarantee this in all cases.)


So if you want page 2 to refer to page 1 then you use something like this:

<head>
<link rel="canonical" href="https://www.example.com/page1.html" />
</head>


If the content is unique on both pages and related to one another then you will be better of using PREV and NEXT.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme