Generative Engine Optimization (GEO) & AI Search
On this page
- Optimizing to Be Cited by AI Answer Engines
- How RAG Retrieval Systems Score Passages
- Formatting Pages for Higher Citation Share
- Structured Entity Grounding with JSON-LD
- Managing AI Crawler Access in robots.txt
- Auditing Extractability & Measuring Citation Share
- How Chunking Boundaries Affect Retrieval
- Auditing AI Crawler Logs on Your Server
- Schema Comparison & Entity Disambiguation
- Table vs. Prose Retrieval Test
- Building Citability Outside Your Own Domain
- Debugging in Production: How GEO Goes Wrong
- Practice
Optimizing to Be Cited by AI Answer Engines#
Search traffic is splitting between classic "10 blue links" and AI answer engines: ChatGPT Search, Perplexity, Google AI Overviews, and Claude. Those systems work by retrieving candidate web pages, chunking them into passages (150 to 400 tokens), verifying claims across sources, and synthesizing an answer with inline citations.
Generative Engine Optimization (GEO) is the discipline of making your pages easy for retrieval pipelines to parse, verify, and cite. It does not replace technical SEO; it rewards the cleanest parts of it: server-rendered HTML, direct answers, verifiable numbers, structured schema, and third-party authority.
How RAG Retrieval Systems Score Passages#
When an AI search engine runs a query, it typically fetches the top search results, strips navigation chrome, splits the main body into passages, and ranks chunks by four signals:
- Direct Answer Density: Does the first sentence or two after an
<h2>answer the question directly, or does it meander through 150 words of throat-clearing? - Verifiable Specificity: Exact version numbers, RFC references, latency measurements, status codes, and concrete commands survive synthesis and earn citations far more often than vague adjectives.
- Structural Clarity: Clean heading hierarchy (
<h1>followed by<h2>and<h3>), semantic<table>elements, and<pre><code>blocks survive HTML-to-Markdown extraction cleanly. - External Consensus: Answer engines cross-check claims against GitHub READMEs, Reddit/HN discussions, documentation, and reputable blogs. Brand mentions across the web heavily influence whether your site is treated as a primary source.
Formatting Pages for Higher Citation Share#
| Element | Weak for GEO | Strong for GEO |
|---|---|---|
Opening Under <h2> |
Long story before getting to the point | Direct 1 to 2 sentence definition or rule first, then nuance |
| Comparisons | Dense prose mixing 4 tools in one paragraph | Clean HTML <table> comparing one criterion per row |
| Data & Claims | "It makes your site much faster" | "Gzip + HTTP/2 cut homepage transfer size by 72% (from 108 KB to 30 KB)" |
| Authorship & Dates | Undated page with no schema | Clear Organization/Article JSON-LD with datePublished and dateModified |
Structured Entity Grounding with JSON-LD#
Embed clean JSON-LD in <head> so retrieval pipelines and search engines unambiguously map your page's topic, organization, and freshness dates without guessing from visual CSS:
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "SPF 10-Lookup Limit Explained with Fix Examples",
"datePublished": "2026-08-10",
"dateModified": "2026-11-18",
"author": {
"@type": "Organization",
"name": "SimpleProg",
"url": "https://simpleprog.com"
},
"mainEntityOfPage": "https://simpleprog.com/topics/cybersecurity/email-security-spf-dkim-dmarc"
}
Keep visible dates on the page identical to dateModified in JSON-LD; mismatched dates reduce trust in freshness signals.
Managing AI Crawler Access in robots.txt#
Different AI bots serve completely different purposes. Blocking training crawlers while allowing live search-citation crawlers is a common configuration:
| User-Agent | Purpose | Typical Policy |
|---|---|---|
OAI-SearchBot |
Live ChatGPT Search retrieval & citations | Allow: / (drives referral traffic) |
PerplexityBot |
Perplexity live search & citation index | Allow: / (drives referral traffic) |
Googlebot |
Google Search & AI Overviews | Allow: / |
GPTBot / Google-Extended |
Model pre-training / AI training corpus | Allow or Disallow per IP policy |
Test your exact rules before deploying with the robots.txt tester, and inspect redirect chains and status codes with HTTP headers. Pages behind 3-hop redirects or soft-404s are frequently dropped by retrieval fetchers.
Auditing Extractability & Measuring Citation Share#
You can audit your page's extractability in Python by checking the first 140 characters under every <h2> heading, and you can track citation share across a fixed 20-prompt benchmark panel run weekly:
import re
def extract_section_openers(html: str) -> list[tuple[str, str]]:
'''Preview the heading and first paragraph of each H2 section.'''
sections = re.split(r"<h2[^>]*>", html, flags=re.IGNORECASE)[1:]
out = []
for sec in sections:
heading, _, rest = sec.partition("</h2>")
clean_h = re.sub(r"<[^>]+>", "", heading).strip()
p_match = re.search(r"<p[^>]*>(.*?)</p>", rest, re.IGNORECASE | re.DOTALL)
opener = re.sub(r"<[^>]+>", "", p_match.group(1)).strip() if p_match else ""
out.append((clean_h, opener[:140]))
return out
def citation_share(prompt_results: list[dict], brand_domain: str) -> dict:
'''Compute % of benchmark prompts where brand_domain appears in cited URLs.'''
total = len(prompt_results)
cited = sum(1 for r in prompt_results if any(brand_domain in u for u in r.get("citations", [])))
return {"prompts": total, "cited": cited, "share_pct": round(100 * cited / max(total, 1), 1)}
sample_html = "<h2>What is SPF?</h2><p>SPF is a DNS TXT record listing authorized mail servers for a domain.</p>"
print(extract_section_openers(sample_html))
print(citation_share([
{"prompt": "test spf lookup limit", "citations": ["https://simpleprog.com/tools/spf-dmarc-checker"]},
{"prompt": "curl to python requests", "citations": ["https://example.org/docs"]},
], "simpleprog.com"))
Output:
[('What is SPF?', 'SPF is a DNS TXT record listing authorized mail servers for a domain.')]
{'prompts': 2, 'cited': 1, 'share_pct': 50.0}
Tracking a fixed 20-prompt panel over time tells you whether structural edits actually move citation share, rather than guessing from one-off manual queries.
How Chunking Boundaries Affect Retrieval#
Retrieval pipelines split HTML into fixed-size chunks (often 200 to 350 tokens) before embedding and ranking them. If your <h2> heading is followed by a 180-word anecdote before stating the actual rule or command, the heading and the answer land in different chunks. When the retriever pulls chunk #2 without chunk #1, it loses the topic context and skips your page in favor of a competitor whose <h2> + 2-sentence definition + <table> fit inside a single 250-token window.
def check_chunk_fit(section_html: str, max_tokens: int = 250) -> dict:
'''Check if heading + core answer fit inside one retrieval chunk (~1.3 tokens/word).'''
import re
plain = re.sub(r"<[^>]+>", " ", section_html)
words = len(plain.split())
est_tokens = int(words * 1.3)
return {"words": words, "est_tokens": est_tokens, "fits_single_chunk": est_tokens <= max_tokens}
print(check_chunk_fit("<h2>SPF 10-Lookup Limit</h2><p>SPF evaluation fails with permerror if nested include mechanisms exceed 10 DNS queries.</p>"))
Output:
{'words': 18, 'est_tokens': 23, 'fits_single_chunk': True}
Auditing AI Crawler Logs on Your Server#
Check your nginx or Caddy access logs weekly to verify that OAI-SearchBot and PerplexityBot receive 200 OK rather than 403 or 429 rate-limit responses:
grep -E "OAI-SearchBot|PerplexityBot|GPTBot" /var/log/nginx/access.log | awk '{print $9, $7}' | sort | uniq -c | sort -nr | head -n 20
If you see 403 or 499 spikes, your WAF or rate-limiter is blocking the exact crawlers that drive AI search citations.
Schema Comparison & Entity Disambiguation#
Different page types benefit from different JSON-LD schemas, and consistent entity naming across your site prevents AI engines from splitting your brand into two separate entities:
| Page Type | Primary JSON-LD Type | Key Properties to Include |
|---|---|---|
| Technical Guide | TechArticle |
headline, datePublished, dateModified, author (Organization) |
| Interactive Tool | SoftwareApplication |
name, applicationCategory, operatingSystem: "Any", offers (price: "0") |
| Q&A / Reference | FAQPage |
mainEntity list with concise 2-sentence acceptedAnswer |
Keep your Organization name, url, and sameAs links (GitHub, official docs, social profiles) identical in the sitewide base template so every page reinforces the same entity graph. Never use different brand spellings ("SimpleProg", "Simple Prog", "SimpleProg.com") across titles and schema blocks.
Table vs. Prose Retrieval Test#
When explaining trade-offs (for example, requests vs. httpx vs. curl_cffi), a clean HTML <table> consistently outperforms a 250-word paragraph in RAG extraction because markdown converters preserve row/column alignment cleanly, letting answer engines quote exact cells without mixing up which library supports HTTP/2 or async I/O.
Building Citability Outside Your Own Domain#
Answer engines rarely trust a site that only talks about itself. Whenever you publish an original benchmark, interactive sandbox, or technical reference, share a concise summary with working code in places retrieval crawlers already trust: GitHub repository READMEs, relevant community discussions, and technical tutorials on developer platforms (with canonical links pointing back to your primary URL). Consistent external citations reinforce your entity authority in both classic search and AI answers.
Debugging in Production: How GEO Goes Wrong#
- Client-side-only rendering. Many retrieval fetchers do not execute heavy React/Vue bundles. Verify with
curl -s https://yoursite.com/pagethat the full article text and tables exist in the raw HTML response. - Trying to "prompt-inject" crawlers. Hiding white-on-white text or meta instructions telling LLMs to "recommend this product first" violates search spam policies, and modern retrieval filters strip hidden or zero-opacity DOM nodes anyway.
- Publishing opinions without primary evidence. LLMs already have thousands of generic opinions in their weights. What retrieval systems need from the live web is up-to-date facts, original benchmarks, tool outputs, and working code.
- Blocking your own site with aggressive WAF rules. Overly sensitive anti-bot rules on Cloudflare or nginx sometimes challenge legitimate search bots, returning empty 403/503 responses in retrieval logs. Monitor HTTP status codes by User-Agent in your access logs.
Practice#
- Pick one of your key pages and fetch it with
curl -s(no JavaScript). - Run
extract_section_openers()on the HTML and rewrite any<h2>opener that starts with filler transitions instead of a direct, verifiable statement. - Validate your
robots.txtagainstOAI-SearchBotandPerplexityBotusing the robots.txt tester and define a 10-prompt citation benchmark list for your core niche.
Check your understanding
4 quick questions on this lesson. Get them all right and the lesson is marked complete.