SEO Audit with LLMs: Automating Codebase and Search Console Analysis

I'm Denis Shokhirev, an enterprise AI architect based in Freiburg, running DennisCraft AI Studio. Over the last six months, I've shipped 14 production AI agents for DACH B2B clients using a stack of Claude, Supabase, n8n, Doppler, and self-hosted Postgres. One recent logistics deployment exposed a recurring pain: manual SEO code reviews and Search Console data checks missed subtle template bugs and cost 6+ hours per audit. Automating these audits with LLMs and static analysis has reduced review time and surfaced issues that previously slipped through.

Production-Grade SEO Audits: Requirements & Pain Points

For regulated B2B in DACH, SEO audits need to go far beyond surface-level meta tag checks. Mistakes in template logic, duplicate content, API data injection, or broken error handling can kill organic traffic or trigger compliance issues. The solution has to be repeatable, stable, and easy to integrate into existing CI/CD pipelines—no “demo scripts”, just real, production-ready tooling.

Audit Architecture: Tools and Patterns

Stack Components

ComponentPurposeReal Tool
LLM InterpretationAnalyze code diffs, generate hypothesesClaude Code
Static AnalysisPattern-based code checkssemgrep, bandit
Search Console DataExtract rankings, CTR, errorsGoogle Search Console API
OrchestrationAutomate the audit pipelinen8n
Result StorageAudit history, dashboardsSupabase/Postgres

End-to-End Orchestration with n8n

n8n triggers the audit (either on code push to main or on a schedule), runs static analysis, fetches Search Console data, and passes results to the LLM for annotation and hypothesis generation. This lets me standardize the workflow across projects and clients, with stable, replicable results every time.

Static Code Analysis: Templates, Middleware, and API Layers

HTML Template and Middleware Checks

semgrep is my first line: it catches duplicated meta tags, missing canonical links, or broken hreflang patterns. I maintain custom rules tailored to the project stack—one bug that popped up repeatedly was missing canonical tags in dynamic templates.


rules:
  - id: missing-canonical
    pattern: |
      <head> ... 
      not: <link rel="canonical" ...>
    message: "Missing canonical tag"
    languages: [html]
    severity: WARNING

API and Backend Audits

bandit is useful for Python backends—especially to catch URL handling issues and user input sanitization errors. In three recent agent deployments, bandit flagged direct string interpolation in the database layer that opened the door for SQL injection (see the 2024 OWASP Top 10, source).


bandit -r ./project/backend/seo

LLM Annotation: Beyond Pattern Matching

Claude Code isn’t just for code generation. I use it to interpret static analysis output, correlate Search Console CTR drops with code diffs, and generate hypotheses. Unlike regex or heuristics, an LLM can spot connections between new code, traffic anomalies, and subtle errors in meta-data or rendering logic.


from anthropic import Anthropic
client = Anthropic()
prompt = f"""
Here's a template diff: {diff}
Here's a CTR drop from Search Console: {ctr_drop}
What are the likely causes? Suggest fixes.
"""
response = client.messages.create(
    model="claude-3-opus-20240229",
    max_tokens=400,
    messages=[{"role":"user","content":prompt}]
)
print(response.content)

Production Example: CTR Drop Traced to Template Change

In one fintech project, Claude Code linked a sudden CTR drop to a new cookie banner rollout that accidentally covered main content on mobile. The connection was missed in manual review but surfaced by correlating template diffs and Search Console anomalies through the LLM.

Automating Google Search Console Data Extraction

The Google Search Console API enables programmatic fetching of rankings, CTR, and indexation errors. I use n8n to extract raw data for all key pages, then hand those metrics to the LLM for anomaly detection and context-aware recommendations.


import requests
from google.oauth2 import service_account
from googleapiclient.discovery import build

SCOPES = ['https://www.googleapis.com/auth/webmasters.readonly']
SERVICE_ACCOUNT_FILE = 'key.json'
credentials = service_account.Credentials.from_service_account_file(
    SERVICE_ACCOUNT_FILE, scopes=SCOPES)
service = build('searchconsole', 'v1', credentials=credentials)

response = service.searchanalytics().query(
    siteUrl='https://client-site.de',
    body={
        'startDate': '2024-03-01',
        'endDate': '2024-04-01',
        'dimensions': ['page'],
        'rowLimit': 1000
    }).execute()
print(response['rows'])

Storing Audit History and Reports: Supabase/Postgres

All audit results, bugs, and recommendations are stored in self-hosted Postgres via Supabase. This enables dashboards, trend tracking, and scheduled report delivery to client teams with zero manual overhead.

FAQ

Which LLM actually works for audit annotation?

Claude Code (Anthropic) has been most reliable for me in production. GPT-4 can work, but needs stricter prompting and more post-processing to avoid hallucinations.

Can this replace manual audits entirely?

No. LLMs and static analysis cut the grunt work, but I still review the final audit, especially for high-risk integrations. Automation reduces false negatives, but human review is essential.

How long does a full audit run take?

For a 1000-page site, the automated pipeline completes in 20–40 minutes. My manual audits for similar volumes took 4–6 hours and missed several subtle issues.

Most common error patterns?

Duplicate titles, missing canonicals, wrong robots meta, unsanitized URL parameters (CWE-89), invalid hreflang, and broken Open Graph tags.

How do you schedule regular audits?

Via n8n, run audits on a schedule or on each main branch push. Output goes to Supabase/Postgres, and dashboards/alerts notify stakeholders.

Where do you catch the nastiest SEO errors in your pipeline—template layer, API, or at the Search Console integration? I’d genuinely like to hear. I run a free 30-min stack audit for DACH founders building AI in regulated markets. DM me on LinkedIn or write to @ger_dennis_ai.

Read more

Computer-Use-Agenten scheitern an Pixeln: wie Sie auf stabile UI-Referenzen über Accessibility Trees umstellen und fehleranfällige Desktop-Automatisierung nicht mehr ständig reparieren

von Denis Shokhirev, Enterprise AI Architect aus Freiburg im Breisgau Ich bin Denis Shokhirev, Agentic AI Systems Architect in Freiburg im Breisgau, Germany, und bei DennisCraft AI Studio setze ich produktive KI-Systeme für DACH-B2B-Kunden auf Basis von Claude, Supabase, n8n, Doppler und selbst betriebenem Postgres um. Die teuersten Fehler in

By Denis Shokhirev

Компьютерные агенты ломаются на пикселях: как перейти на stable UI refs через accessibility tree и перестать чинить flaky desktop automation

Я Denis Shokhirev, Agentic AI Systems Architect из Freiburg im Breisgau, Germany, и в DennisCraft AI Studio я собираю production AI-системы для DACH B2B на Claude, Supabase, n8n, Doppler и self-hosted Postgres. Самая дорогая поломка в desktop automation, которую я вижу у клиентов, почти никогда не связана с моделью: агент

By Denis Shokhirev