How to add a site to Google Search Console via HTML file

H

How to add a site to Google Search Console via HTML file

Creating an account in Google Search Console requires a Google account. If you don’t have one – check out our guide “How to Create a Google Account.

If you already have an account – below you will find step-by-step instructions on how to add a site to Google Search Console.

  1. Go to https://search.google.com/search-console/about and click the “Start” button.
  2. Sign in to Google Search Console using your Google account.
  3. You will be greeted with a screen offering options for how you want to authorize/add your site to Google Search Console.

The first option is domain verification, the second is URL prefix verification.

How to add a site to Google Search Console

What’s the difference?

The first option, adding a domain, allows you to access data from all versions of your site in one place. You will see data for all subdomains (if you enter the domain), e.g., with and without www, and all URLs in both HTTP and HTTPS versions.

If you add the site as a URL prefix, you will only see addresses related to the specified URL (i.e., from the given domain or subdomain) and only within the specified protocol – e.g., only HTTP addresses if you provide a URL with that protocol.

What is a URL prefix? It is the version that a URL takes, distinguishing between those that have a security protocol, e.g.,

https://revamper11.com

do not have an SSL certificate, e.g.,

http://revamper11.com

and those that may have different subdomains – e.g., the www subdomain. In the basic combination, we thus distinguish the URL in the following prefixes:

http://revamper11.com

http://www.revamper11.com

https://revamper11.com

https://www.revamper11.com

Authorization using URL prefix:

There are 5 ways to authorize using the URL-prefix method. Here we show how to do this via HTML file.

Authorization using HTML file

Step 1

Download the file with the code snippet from Google Search Console (don’t worry, the code is just one line – so it’s nothing burdensome).

Google Serach Console Authorization using HTML file

Example code:

google-site-verification: google26293c81d4ccc9e2.html (IMPORTANT: each verified address will have its unique code).

Step 2

Place the verification file with the code on your website. It should be placed in the main directory, preferably in the <head> section of the page.

Example: Let’s assume our site has the address https://revamper11.com, and the file we need to place is named XYZ.txt. Under these assumptions, it should be accessible at https://revamper11.com/XYZ.txt.

IMPORTANT:

Do not modify the file name or its content in any way.

Step 3

After placing the file, it’s good to check if it is visible by entering the address https://revamper11.com/XYZ.txt in your browser. What you should see looks something like this:

Google Serach Console HTML file example

If you do not see the file and it is not accessible to your browser at this URL, Google will not be able to find it for verification purposes. Then verify whether it is indeed in the correct section of the code. You can do this by viewing the page source (i.e. view-source:https://revamper11.com/) and then searching for the keywords “google-site-verification” (CMD + F / CTRL + F).

View source
View source

TIP: Check the address with the file in incognito mode to ensure you are seeing the version of the page not loaded from the cache.

Step 4

Complete the verification by clicking the “Verify” option.

Troubleshooting

During the verification of the HTML file submission, the following errors may occur:

INTERESTING FACT:

Search Console will not check if the file is correctly embedded if there is any redirection set to another domain on the site. If your site redirects all traffic to another site, it is recommended to use HTML tag verification instead.

Some examples of supported and unsupported redirects:

http://example.com to http://www.example.com—Supported

http://example.com to https://example.com — Supported; redirects to a new protocol (http/https) are supported.

example.com to revamper11.com — Not supported, different domains.

We also recommend checking out the official video guide from Google:

Check out the other methods:

About the author

Bartosz Nalepa

SEO specialist by day, horror novel aficionado by night. When I'm not crafting killer content or conquering the SERPs, you can find me shredding the gnar, acing the tennis court, or lost in the pages of a Stephen King masterpiece. With 3 years of SEO experience, a knack for coding, and a passion for Excel, I'm trying to crack the code of what the heck Mr. Google has in his mind!

By Bartosz Nalepa

Get in touch

The Search Console Blog is your one-stop shop for everything you need to know about Google's premier tool for monitoring and maintaining your website's search rankings and indexing health.

Stay up-to-date by following us on social media.