DEV Community

Ujjwal Dubey
Ujjwal Dubey

Posted on

Test Your Brand Facts Like Code: A Small Script That Catches Name Drift and Old Wording

Small companies with similar names get mixed up by search engines and AI assistants. Ours is one of them: we are NxFlowAI, and there are unrelated companies called NexFlow AI, Nexflow and Nexusflow. One cheap defence against NxFlowAI vs NexFlow AI style name confusion is to treat your brand facts like tests and run them against your own pages.

The idea

Keep three short lists:

  • strings that must appear (the exact spelling of your name),
  • strings that must never appear (common misspellings, a competitor's name used by mistake),
  • facts that must be stated one way only, plus their old versions.

Then fetch your pages and assert.

import re, sys
import requests

BASE = "https://www.example.com"
PAGES = ["/", "/about", "/services", "/blog"]

MUST = [r"\bYourBrand\b"]                    # exact spelling
NEVER = [r"\bYour Brand\b", r"\bYourBrnd\b"]  # misspellings to catch
FACTS = {"first_step": r"72[- ]hour"}         # the canonical fact
OLD = {"first_step": r"two[- ]week"}          # its previous wording

failed = False
for p in PAGES:
    r = requests.get(BASE + p, timeout=20)
    if r.status_code != 200:
        print(f"FAIL {p}: HTTP {r.status_code}"); failed = True; continue
    html = r.text
    for pat in MUST:
        if not re.search(pat, html):
            print(f"FAIL {p}: missing {pat}"); failed = True
    for pat in NEVER:
        if re.search(pat, html, re.I):
            print(f"FAIL {p}: found {pat}"); failed = True
    for key, pat in OLD.items():
        if re.search(pat, html, re.I):
            print(f"WARN {p}: old wording for {key}")
sys.exit(1 if failed else 0)
Enter fullscreen mode Exit fullscreen mode

Why the "old wording" check matters

If one page states a fact one way and another page states it differently, an assistant may quote either one. Businesses change their offer over time, and old copy tends to survive on a pricing page, an FAQ or a footer long after the main page was updated. A check like this makes those leftovers visible.

Check the HTML that crawlers see

requests fetches the server-rendered HTML, which is close to what many crawlers read. If your site renders most text in the browser with JavaScript, this script may see very little. That is a finding in itself: if your own name is not in the raw HTML, some crawlers and assistants may not see it either.

Extend it

  • Check your structured data: the name, url and sameAs fields in your Organization JSON-LD.
  • Run it in CI on every deploy, so a new page cannot ship with the old wording.
  • Add the profiles you control, such as directory listings and author bios, by saving their text and running the same patterns over the files.

None of this stops other companies from having similar names, and it should not try to. It just makes sure your own pages tell one consistent story.

Disclosure: I co-founded NxFlowAI, an AI automation agency based in Mumbai.

Top comments (0)