Canonical URL - Issues with Google Indexing


I’m trying to get my custom domain indexed by Google but it ignores my user-selected canonical ( and selects my URL ( - recently changed to instead.

I’m not sure why this is happening. I’ve redirected all routes to my custom domain using netlify.toml. My custom domain is set as my canonical link in my HTML head. I’m guessing Google is seeing duplicate content and selecting over my custom domain for some reason. Any suggestions?

Netlify adds a canonical HTTP header on the subdomain. This must be the reason.

@Dnoel26 How recently did you make these changes? Google doesn’t exactly turn on a dime … it can take them days or weeks or months to recognize changes.

Also, it looks as though you have the same canonical link for each of your pages:

<link rel="canonical" href="">

Each page must have its own unique link for it to be considered canonical.

Hi @gregraven,

These changes were made fairly recently (between 1-2 weeks). I know it takes a while to show up, but the reason I asked was because everything was fine before. A google search for my name showed my custom domain and the Google search console showed it as being indexed.

I made some changes to the head (title and description) and re-deployed a few times and after a while my domain started showing instead. When I checked the console, my page was no longer indexed and Google selected the version as canonical.

The site is really only a single page so that’s why I set that canonical link. I didn’t set any for the other 3 (two Google Lighthouse reports and a PDF viewer page). Would they default to the same if left out?

I suppose I’d just have to wait to see if Google eventually updates.

@Dnoel26 The way I understand it, the canonical link should be specific and unique … with index.html, about.html, etc. Having no specificity and a bunch of text dilutes your search results.

Just an update.

Changing the site name, then changing it back to the original seemed to work. My site is now indexing again.

1 Like

Thanks so much for coming back and letting us know! We appreciate it :netliconfetti:

1 Like