%%
Last Updated:
- [[2021-02-14]]
%%
Some sites, such as my [[Obsidian Publish]] site, don't get indexed by Google. Here's how to fix that.
## Setup the domain with Google Search Console
To force [[Google]] to index a domain (or subdomain), go to the [Google Search Console](http://search.google.com/search-console).
Select "Domain" instead of "URL prefix" and enter the main domain here.
You'll need to do this step even if it's a subdomain you actually want indexed.
## Verify ownership of the domain
Google will ask you to add verify that you own a domain by adding a text record. It will give you a code to copy.
### Add TXT record on hosting provider
Log into your account with your hosting provider and add a `TXT` record there.
For `Host Record`, use `@`. Paste the verification code as its value.
## Wait for Google to successfully verify ownership
It may take a while for the DNS record to propagate. Once it does, click "Verify" in the Google Search Console and you should see something like this:
![[Pasted image 20210214171442.png]]
## Check whether your URL is being indexed
In Google Search Console, type in the URL you want to inspect.
![[Pasted image 20210214171641.png]]
If you see something like the above screenshot, that URL isn't being indexed.
## For subdomains
Click the hamburger menu > Add property. This time, in the "URL Prefix" option, type in your subdomain.
You should get this message:
![[Pasted image 20210214172333.png]]
## For pages within a domain
The instructions here only pertain to a domain or subdomain. Google should be able to crawl all the pages within it.
If that doesn't happen, one option is to generate and upload a [[Sitemap]] to Google Search Console.
## References
- [[Mike Lesiuk]] (aka [@refinedrobot](https://twitter.com/refinedrobot)) on the [[Obsidian]] [[Discord]], who walked me through the process. :)