Google Indexed Netlify Subdomain instead of my Custom Domain

Hey Guys :slight_smile: i need help with my small website, Google Search results show the subdomain instead of my custom domain. This was working for the past 3 weeks, then i tried yesterday to check again since google notified me that it reached 900+ clicks but it wasn’t indexed by Google i can’t find it anymore in the search results, so i resubmitted the url to be indexed again in ‘Google Search Console’ but when it was indexed what’s showing in search results is ‘Netlify’ and not the title of my website, you can also see that the site is referring to the subdomain and not my custom domain

Screenshot 2024-05-24 at 11.52.08 PM

before what was shown above is:

letterstocasper.ph
https://letterstocasper.ph

Now here’s what i did so far:

i added a _redirect inside the public/ of my react app

https://letterstocasper.netlify.app/* https://letterstocasper.ph/:splat 301!
/* /index.html 200

also added a canonical tag in public/index.html

<link rel="canonical" href="https://letterstocasper.ph/" />

After I added those, I submitted it again to index my site, but it still displays ‘Netlify’ :frowning:

oh nevermind it seems working now :smile: changed the canonical tag to

<link rel="canonical" href="https://www.letterstocasper.ph/" />

since i change my primary domain in Netlify to www

Another thing you could do @dids-reyes is create a header rule such as

https://letterstocasper.netlify.app/*
  X-Robots-Tag: noindex
1 Like

I’m back again after 2 weeks google indexed my website again now it has :splat included in the url so users think the website is not working when searching through google :frowning:

This is the link google indexed again
https://www.letterstocasper.ph/:splat

Remove web results from Google Search - Google Search Help

@hrishikesh It’s indicated in the answer that it could remove all so i haven’t tried the Removal Tool

It won't keep your favorite version of a page; instead, could remove all versions (http/https and www/non-www) of a URL.

It’s up to you and Google to decide how to handle it. There’s not much Netlify can do here.

1 Like

okay thank you @hrishikesh