Yes, you are using canonical links correctly.
Google and other search engines use your canonical tags.
To resolve cases of where duplicate content exist ... Allow me to explain the correct usage before getting into cases of why.
Say www.mywebsite.example/page1
and www.mywebsite.example?page=1
are the same because of the content management system I'm using. And I want to use the friendly URLs. This tag tells Google to use www.mywebsite.example/page1
as the URL for this content; so if Google finds www.mywebsite.example?page=1
it will know that is not the best URL for this content ... use www.mywebsite.example/page1
<link rel="canonical" href="https://www.mywebsite.example/page1" />
on www.mywebsite.example?page=1
and www.mywebsite.example/page1
Some software does not recognize dynamic content (they should!)
That www.mywebsite.example?page1
and www.website.example/
are not the same. IE it wants me to put a canonical to www.mywebsite.example
" on www.mywebsite.example?page1
Let them know as their program is not looking to see if the pages have the same content or different content.
Dynamic content creates different pages using a www.example.com?tag=value
which are completely valid, and not the same as the www.example.com
so a canonical to the www.example.com
is not wanted on ?tag=value for a CMS system.
Note www.example.com?theme=dark
would be the same as www.example.com
(except for CSS) in which case a canonical would point towards the www.example.com
page. But that is not the case here.
Cases of duplicate content that can be resolved by canonical
I have mysite.example.com
publicly available online and mysite.example
... because that is the setup of the example hosting company so I can access the site before I register the domain mysite.
I have example.com
and www.example.com
both providing the same content.
I have www.example.com
and www.example.com
on http and HTTPS both providing the same content. As the content does not require logging in but I want to use HTTPS for privacy of the user. So the HTTPS content is mapped to the same HTTP content on my host.
I have a CMS system where www.example.com?page=canonical
and www.mydomain.example/canonical
are the same because the CMS system is designed not to require friendly URL but to be configured to use them if desired.
I have an option for users to see pages in different languages via machine translation ... This duplication may happen using Google's own tool? ... www.example.com
and www.example.com?lang=spanish
I have a custom meme generator which passes the text via the URL but the page is the same, www.example.com/meme?text=this+shows+on+the+image
. I want Google and other search engines use canonical tag
<link rel="canonical" href="https://www.example.com/meme" />
.htaccess
redirect can be used to prevent duplicate content being exposed in some cases.
In the first 4 cases a redirect could also solve the problem although the first one exists for a very good reason. Cases 5 and 6 would not be resolvable using a redirect. Case 4 may have very compelling reasons to exist. It may need to do so for editing the content for example.
Regardless canonical is a needed tool because cases do exist.
example.com/page2
... The canonical tag tells Google which is the correct URL to use for said content ... The correct URL you want Google to use is the URL "you" want. Hence you are telling Google which one is correct, not Google telling you. Both pages should agree that say ?page=2 or/tag/2
is the one that should appear in Google.<link rel="canonical" href="https://www.example.com" />
for my home page and go to page 2 e.ghttps://www.example.com?page=2
, some SEO inspector tools giving me warning ofCanonical and page URL are different
should I ignore this warning even though content on page one is not same from page 2. I don't want Google to get confused from home page and paginated pagesmyWebsite.example
has unique content and the content ofmyWebsite.example?page=2
is unique and not the same content asmyWebsite.example
then the canonical should not be the same, (in other words), like you are saying. The inspector appears to be unaware they are not the same content, the inspector does not understand dynamic content. ... I would advise the people who made the SEO inspector and see what they say. Have you considered making the URLs more friendly IEwebsite.example/page2
instead ofwebsite.example?page=2
example.com/page2/
and can access the URL fromexample.com?page=2
then the duplicate content which results can be resolved using<link rel="canonical" href="https://www.example.com/page2/" />
... so that you don't have duplicate content, (or to say you do but not intentionally and you want the friendly URL indexed). If you don't have duplicate content exposed then you don't need to use the tag.