Verify Google Search Console

There are several ways to verify domain ownership when you add your website in Google Search Console.

Verifying by DNS TXT record is the best method as it doesn't require you to add any code on your website.

How to verify domain ownership via DNS record for Google Search Console

When you first add your website in Google Search Console you will be greeted by a screen that gives verification options. Select DNS verification and copy the verification code.

Google Search Console DNS verification code

The next step is to navigate to the Templ Panel and click Domains → YourDomain.com → Manage DNS.

Keep in mind that you have to be using our name servers for the domain, so that the DNS is managed by us, otherwise you cannot manage your domain's DNS records through Templ. If your DNS is managed elsewhere, add the same TXT verification record at your DNS provider instead, or switch to Templ-managed DNS.

Templ Panel Manage DNS button on the domain page

Add the verification code

It's likely there will already be a TXT record for your domain that you need to edit and add the verification code to. See below screenshot for reference:

Templ Panel DNS management showing the existing TXT record

Click on the TXT record for your root domain (e.g. yourdomain.com without any prefix or subdomain) to edit the record.

Add your Google site verification code wrapped in quotes on a new line like this:

"google-site-verification=VkX8XHiESy97AZcZMEaoufTXErpIkiQyr5c7I_kdpr4"

Templ Panel TXT record editor with Google verification code on a new line

Once you have added your Google site verification code on a new line, go ahead and click Save.

Then wait a minute or two for the DNS to propagate then go back to Google Search Console and click Verify and you're all done.

Google Search Console Verify button after adding the TXT record