How to add Google Search Console to WordPress

To add Google Search Console to WordPress, create a property for your site in Search Console, prove you own it with a DNS TXT record or an HTML meta tag, then submit your XML sitemap. The DNS method needs no plugin and no code, and it covers every version of your domain at once, so use it whenever you can reach your DNS settings.

Google Search Console is free, and it is the only place Google tells you directly which of your pages it indexed, which it skipped and why, and which searches you appear for. Every indexing guide on this site assumes you have it set up.

Step by step

1. Choose a property type

Go to search.google.com/search-console, sign in and click Add property. You get two choices:

Property typeWhat it coversHow you verify
Domainexample.com plus every subdomain and both http and httpsDNS TXT record only
URL prefixOne exact address, such as https://www.example.com/HTML tag, HTML file, Google Analytics, Tag Manager or DNS

Pick Domain if you can edit DNS. It means you never miss data because Google indexed the www version while you verified the bare domain.

2. Verify a Domain property with a DNS TXT record

  1. Enter your bare domain, for example example.com, and click Continue.
  2. Copy the TXT record Google shows. It starts with google-site-verification=.
  3. Log in to wherever your DNS is managed. That is usually your registrar, your host, or a service like Cloudflare if your nameservers point there.
  4. Add a new record: type TXT, name @ (or blank, depending on the provider), and the copied value as the content.
  5. Go back to Search Console and click Verify.

If it fails, wait and try again. DNS changes can take a while to propagate. You can leave the Search Console tab and come back later; the record does not expire.

3. Or verify a URL prefix property with the HTML tag

If you cannot touch DNS, choose URL prefix and enter your site address exactly as visitors see it, including https:// and www if you use it. Pick HTML tag and copy the meta tag.

The tag has to be in the <head> of your homepage. Hydrogen SEO's documented way to add it is the hydrogen_seo_print_meta action, which prints inside the plugin's head block. Add this to a child theme's functions.php or a code snippets plugin, with your own code:

php
add_action( 'hydrogen_seo_print_meta', function () {
    echo '<meta name="google-site-verification" content="YOUR-CODE" />' . "\n";
}, 20 );

Many themes and other SEO plugins also have a "header code" or webmaster verification field. Any of these work, as long as the tag ends up in the head. The HTML file option also works: upload the file Google gives you to your site's root folder over SFTP or your host's file manager.

4. Confirm the tag is live, then click Verify

Open your homepage in a private window, view the page source and search for google-site-verification. If it is missing, clear your page cache and any CDN cache, because cached HTML from before the change will not contain the tag. Once you can see it, go back to Search Console and click Verify.

5. Submit your sitemap

In the new property, open Indexing → Sitemaps, paste your sitemap index URL and click Submit. With Hydrogen SEO, copy the URL from the Hydrogen SEO → Sitemap screen rather than guessing the path. The full walkthrough, including what the statuses mean, is in how to submit a sitemap to Google.

6. Add your team as users

Do not share your Google login. Open Settings → Users and permissions and click Add user. Give developers and agencies Full access if they need to submit sitemaps or request indexing, and Restricted access if they only need to read reports. Only owners can add other owners.

7. Add Bing Webmaster Tools while you are here

Sign in at bing.com/webmasters and choose the option to import your sites from Google Search Console. Bing copies the verified property across, so you skip a second verification, and you can submit the same sitemap there.

Check it worked

  • Settings → Ownership verification shows your verification method and when it last succeeded.
  • Paste your homepage URL into the search bar at the top of Search Console. The URL Inspection result should load and tell you whether the URL is on Google. For a new site, check if a page is indexed explains the results.
  • The Pages and Performance reports can take a few days to fill in for a new property. Empty reports on day one are normal.

Common mistakes

  • Verifying the wrong URL prefix. https://example.com/ and https://www.example.com/ are different URL prefix properties. If your site redirects to www, verify the www version, or use a Domain property and stop worrying about it.
  • Removing the tag or DNS record after verifying. Google rechecks ownership. Take the record away and you can lose access. Leave it in place for as long as you use the property.
  • Putting the tag in the page body. A tag pasted into a post or a widget lands in the body, not the head, and verification fails.
  • Verifying a staging site. If staging is on a subdomain, a Domain property includes it. That is fine for reporting, but make sure staging itself is not indexable.

Common questions

Do I need a plugin to connect Search Console to WordPress?

No. The DNS TXT method happens entirely at your DNS provider, and the HTML file method only needs a file upload. A plugin or code snippet is only needed if you choose the HTML tag method.

Should I use a Domain or a URL prefix property?

Use a Domain property if you can edit DNS, because it covers every protocol and subdomain in one place. Use URL prefix when DNS is out of your hands.

How long until Search Console shows data?

Verification is instant once Google sees the record or tag. Reports usually start filling in within a few days, and indexing data for a brand new site depends on how quickly Google crawls it.

Can I remove the verification tag once I am verified?

No. Google periodically rechecks verification, and removing the tag or DNS record can cost you access to the property.