On 25 November 2026 my Cloudflare account held 37 zones, and most of them had never been added to Search Console. By the end of the run, 36 domains were verified as domain properties, 28 sitemaps had gone to both Google and Bing, and the final scan of the 26 live sites showed no critical, high or medium findings. I did the work with a skill I wrote for Claude Code. The skill itself is not public, but the approach is the same for every domain and easy to repeat. This post covers the order, the official API endpoints I used and five traps that slowed me down.
Classify first, then set up
The first step writes nothing. I scanned every domain from the outside and put it in one of four classes:
- live: the home page returns 200 and should be indexed. It gets the full flow.
- pre-launch: there is no apex or www record. The domain property is opened now anyway, because data only starts accumulating once the property exists. No sitemap, no code fixes.
- down or broken: 5xx, a 404 home page, a Cloudflare error page. The property is opened, the problem goes into the report as critical, and the owner is asked.
- noindex on purpose: admin panels, staging and app subdomains. They get no separate property; the domain property already covers them.
Of the 37 zones, 5 were down or unreachable and 4 had not launched yet. One live site was serving noindex,nofollow, and that was not intentional. Without the classification step I would have submitted a sitemap for that site, and Google still would not have indexed it.
The outside scan checks the same list on every site: the redirect chain, the canonical host, noindex and X-Robots-Tag, canonical tags, hreflang, JSON-LD, the Sitemap: line in robots.txt, the sitemap itself (do sample URLs return 200, are they self-canonical), llms.txt and HSTS.
Verify the domain property over DNS TXT
I used domain properties rather than URL-prefix properties. One property covers every subdomain and both the http and https versions. Verification goes through DNS, so nothing has to be placed on the site, no file and no meta tag. The flow is four calls across two Google APIs:
- Get a token from the Site Verification API:
POST https://www.googleapis.com/siteVerification/v1/token, withINET_DOMAINassite.typeandDNS_TXTasverificationMethodin the body (getToken). - Write the returned
google-site-verification=...value to the zone as a TXT record through the Cloudflare API. - Wait until a public resolver sees the record, then verify:
POST https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=DNS_TXT. - Add the property to Search Console:
PUT https://www.googleapis.com/webmasters/v3/sites/{siteUrl}. For a domain property,siteUrltakes the formsc-domain:denizbarish.com.
Two details matter. Do not delete the TXT record after verification; if it goes, so does the verification. For credentials I used an OAuth desktop client on my own Google account. While the OAuth consent screen is in "Testing", the refresh token expires after 7 days, so switch the app to "Production" before starting any bulk run.
The bulk loop has a shell trap too. Unlike bash, zsh does not split an unquoted variable into words. Loop over a domain list in zsh with for d in $LIST and the loop treats the whole list as a single domain. I wrote the loop inside bash -c. At the end I compared the Search Console property list with my own list and re-added whatever was missing.
Do not submit a dirty sitemap
On the first pass, 15 sites had clean sitemaps and went straight out. Ten needed code fixes first: product pages missing from the sitemap, template records that had leaked into it, placeholder pages left live. I submitted those after the fixes were deployed. The rule is simple: every URL in the sitemap returns 200, is indexable and is canonical to itself. If not, fix first and submit second.
The submission itself is a single call: PUT https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath} (sitemaps.submit). Where a sitemap index existed, I submitted only the index, and made sure it was the same URL as the Sitemap: line in robots.txt.
A domain property inherits old sitemaps
This was the most unexpected finding of the run. A domain property also lists the sitemaps submitted to every URL-prefix property the domain has ever had, whether those came from a previous owner, an old CMS or an attack.
One site turned up sitemaps left behind by a spam injection from 2020: randomly named XML files, PHP addresses with a ?sitemap query, and mail. and fr. subdomains that now point somewhere else. Another site still listed dead sitemaps from 2013 to 2017. I deleted all of them with the owner's approval.
The lesson: never copy the Search Console sitemap list somewhere else as it is. I had forwarded part of it to Bing and had to remove those entries there one by one as well. Now Bing only receives the sitemap that robots.txt points to today.
Bing: one click, then the API
Bing Webmaster Tools can import sites from Search Console, and that added all 36 sites to Bing without a separate verification (Bing's announcement). The import is done in the web interface and only needs doing once. I then sent any missing sitemaps with the SubmitFeed call in the Bing Webmaster API.
Bing's rate limit is strict. Three sites hit a ThrottleUser error, and because the daily quota was used up, those three waited until the next day. Staying under about 25 calls per batch and pausing between requests avoids the error.
Hook IndexNow onto the last step of the deploy
IndexNow is an open protocol for telling search engines yourself which URLs changed. Google does not use it; Bing and Yandex do. Setup has two parts. First, you put a file named <key>.txt in the site root, containing nothing but the key. The key is 8 to 128 characters long and may contain letters, digits and dashes. Then you send the URL list in a single JSON request. The format from the official documentation is:
POST https://api.indexnow.org/indexnowContent-Type: application/json; charset=utf-8{"host": "denizbarish.com", "key": "<key>", "keyLocation": "https://denizbarish.com/<key>.txt", "urlList": ["https://denizbarish.com/blog", "..."]}
One request can carry up to 10,000 URLs. A 200 or 202 response means the request was received; 202 says key validation is still pending. A 403 means the key file was not found or its content does not match. A 422 says the URLs do not belong to the host, and a 429 means you hit the rate limit.
In Next.js projects I put the key file in public/. This site has no deploy script, so I sent its URLs by hand; 60 URLs went out with a 200. In projects with CI, I attached the ping to the last step of the deploy job with three rules:
- It runs only after a successful deploy, and never fails the deploy: in GitHub Actions that means
if: success()andcontinue-on-error: true. - It waits for the key file first: if the request goes out before the new release is live, the key file returns 404 and IndexNow answers 403. The step polls the file for up to a few minutes.
- It builds the URL list from the sitemap in robots.txt: if that is a sitemap index, it opens one level. A hand-maintained URL list goes stale with the first content change.
One small detail cost me time: Python's default Python-urllib user agent got a 403 from sites behind Cloudflare. Every request in the script needed a browser-like user agent.
Scan one site at a time
One day I ran the outside scan in parallel. The intrusion detection rule on the server read that as probing and blocked my Mac's IP address for 4 hours, SSH included. Since then bulk scans run one site at a time, with a few seconds between sites. If your own server runs fail2ban, CrowdSec or something similar, you will hit the same wall.
Not everything the scan found was about Search Console. On six sites, Cloudflare's email obfuscation was injecting its own markup into the HTML and causing React hydration error 425; I turned the feature off. On the 26 live zones I enabled HSTS with a six-month max-age. I left out includeSubDomains and preload; both are commitments that reach beyond one hostname and are hard to take back. On seven sites, Cloudflare's "Block AI bots" setting would not change through the API (the requests returned 503 and 504), so it was switched off in the dashboard. Search crawlers are allowed on every site; allowing training crawlers was a separate, deliberate decision.
A false alarm in my own tool
A weekly health report runs every Monday at 09:30 through a LaunchAgent. For each domain property it reports the change in clicks and impressions against the previous 28 days, opportunity queries and URL Inspection results. The URL Inspection API allows 2,000 requests per site per day (quotas); the weekly report inspects only 5 URLs per site, a manual health check 10 to 20.
The first version of the scan script warned on three sites that "every sitemap URL carries the same lastmod date". The warning assumed the date was faked. In reality, a single commit on each of those sites had touched a shared layout file, so every page really did share the same change date. I changed the check. A single date now raises a medium warning only when it is within an hour of the sitemap response's Date header, because that shows the date was generated at request time. If the date is older and the sitemap has more than 50 URLs, the warning stays low, and on smaller sites it does not appear at all.
If you also want to audit the zone settings on the Cloudflare side, auditing a zone with claudeflare is the other half of this work. My other tools are on the projects page. When you apply this flow to your own domains, keep to one order: classify, clean the sitemap, and leave submission for last. Submitting a dirty sitemap leaves you a longer cleanup than not submitting at all.


