How to Perform Google Search Console (a.k.a Google Webmaster Tools) Verification with Discourse

(Rory Craig-Barnes) #1

This #howto goes over the methods you can use to verify domain ownership for Google Search Console, while using Discourse.

There are two methods you you can use to do this verification:

  1. Create a TXT DNS record - this is your best option!
  2. Add HTML Tag - only use this method if you don’t have DNS access, or can’t get a TXT DNS record to work.

Both methods start out the same:

  1. In the Google Search Console (GSC) https://search.google.com/u/1/search-console setup a new property by entering the URL of your forum

  1. GSC will attempt to verify your ownership of the domain, which should fail. You will then be presented with a list of ways to verify your ownership.

Method 1: Create a TXT DNS Record

  1. In the verification options, select Domain name provider
    Note: currently this takes you to the old GSC console, so it looks different.

  2. In the list of domain registrars, find your DNS provider. If it isn’t listed, select other.

  3. In the steps below GSC will provide you with a string that looks similar to:
    google-site-verification={string here}

  4. If your registrar was listed, follow the directions Google provides.

  5. If your registrar wasn’t listed, you may need to contact your DNS providers support, the general process is:

    1. Log into your DNS provider
    2. Manage DNS entries for the domain
    3. Create a new TXT entry
      1. Make sure the hostname (or name) you use is the sub-domain of your forum or * if it is on your root domain, and the value should be pasted exactly as GSC provided it.
      2. Save the entry
  6. Now go back to GSC, select Verify, under Domain Name Provider

  7. Your domain should now be verified.

Method 2: Add HTML Tag

  1. In the verification options, select HTML Tag - this will give you a unique verification tag, copy this whole tag, you will need to shortly

<meta name="google-site-verification" content="{unique string}">

  1. Go to the Discourse Admin and go to the following page: Admin>Customize>Themes, then select “Components”
  2. Create a new theme component, give it a meaningful name (i.e. “GoogleSearchConsoleVerification”)

  1. In your new component, select Edit CSS/HTML, under Custom CSS/HTML

  1. In the </head> section, paste the HTML tag generated by GSC Verification Wizard, then Save this change.

  1. Go to Admin>Customize>Themes, then select “Themes”
  2. Add the theme component you just created to each available theme on the left, making sure one of your themes has the “Theme is enabled by default” option checked

  1. Now go back to GSC, select Verify, under HTML Tag
  2. Your domain should now be verified.
12 Likes