How to optimize an AI-built website for search and AI answers

An AI-built site is ready for search and AI answers when crawlers can read every page as HTML, each page has its own title, description and social preview, the business is described in structured data, and Google and Bing have your sitemap. Most sites generated with Claude, Bolt or Lovable get the design right and miss several of these. This guide walks through each one with copy-and-paste examples and the prompts we use to have Claude add them.
If you are still building, start with how to build your own website with Claude. For the background on why these signals matter, see answer engine optimization and llms.txt, schema and Open Graph.
Step 1: make sure pages are readable HTML
Many AI tools generate a single-page application: the server sends an almost empty page and JavaScript builds the content in the browser. Google can often render it, but other crawlers, link previews and many AI tools read the raw HTML and see nothing.
Check it: open a page, choose "View page source" (not Inspect), and search for a sentence from the page. If it is not there, fix it by using static site generation or server-side rendering, for example Next.js with static export, Astro, or a pre-rendering plugin for Vite.
Prompt for Claude Code:
Make every route pre-rendered to static HTML at build time so the full page content, title and meta tags are in the HTML source. Show me how to verify it with view-source.
Step 2: unique titles and descriptions on every page
Every page needs its own title tag, meta description, one H1 and a canonical tag. AI-generated sites often reuse the site name everywhere.
<title>Emergency plumbing in Naperville | Acme Plumbing</title>
<meta name="description" content="24/7 emergency plumbers serving Naperville and Aurora. Licensed, insured, upfront pricing. Call or book online.">
<link rel="canonical" href="https://acmeplumbing.com/emergency-plumbing">
Step 3: robots.txt and the sitemap
Your robots.txt should allow search and AI crawlers you want and point to your XML sitemap:
User-agent: *
Allow: /
Sitemap: https://acmeplumbing.com/sitemap.xml
The sitemap should list every page you want indexed, with absolute URLs, and regenerate on each build. Ask Claude to generate it from your routes so new pages are never missed. If you want to opt out of specific AI crawlers, add rules for them by name; our llms.txt and schema post covers the main crawler names and the trade-offs.
Step 4: add llms.txt
An llms.txt file sits at the root of your site and gives AI tools a short, plain-text map of your most useful pages:
# Acme Plumbing
> Licensed plumbers serving Naperville, Aurora and the western suburbs since 2009. Emergency service 24/7.
## Services
- [Emergency plumbing](https://acmeplumbing.com/emergency-plumbing): 24/7 response, typical arrival times, pricing approach
- [Water heaters](https://acmeplumbing.com/water-heaters): repair and replacement, tank and tankless
## Company
- [Service areas](https://acmeplumbing.com/service-areas)
- [Contact](https://acmeplumbing.com/contact)
Treat it as a helpful extra, not a ranking lever. Keep it accurate when pages change.
Step 5: local business structured data
Structured data in JSON-LD tells search engines and AI tools exactly who you are, where you are and when you are open. For a local business, put this on the home or contact page, using the most specific type that fits (Plumber, Dentist, Attorney, HVACBusiness and so on):
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Plumber",
"@id": "https://acmeplumbing.com/#business",
"name": "Acme Plumbing",
"url": "https://acmeplumbing.com",
"telephone": "+1-630-555-0100",
"image": "https://acmeplumbing.com/images/storefront.jpg",
"logo": "https://acmeplumbing.com/images/logo.png",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "Naperville",
"addressRegion": "IL",
"postalCode": "60540",
"addressCountry": "US"
},
"geo": { "@type": "GeoCoordinates", "latitude": 41.7508, "longitude": -88.1535 },
"openingHoursSpecification": [{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday","Tuesday","Wednesday","Thursday","Friday"],
"opens": "07:00",
"closes": "18:00"
}],
"areaServed": ["Naperville", "Aurora", "Lisle", "Wheaton"],
"sameAs": [
"https://www.facebook.com/acmeplumbing",
"https://www.linkedin.com/company/acmeplumbing"
]
}
</script>
Rules that keep it trustworthy:
- Match your Google Business Profile exactly: name, address and phone. See Google Business Profile and local SEO.
- Mark up only what is visible on the page. Do not add reviews, ratings or FAQs that visitors cannot see.
- Service-area businesses without a public address can omit the street address and rely on areaServed.
- One entity, referenced everywhere, using the same @id.
Step 6: structured data for the rest of the site
| Page | Schema types |
|---|---|
| Every page | WebSite (once), Organization or LocalBusiness, BreadcrumbList |
| Service pages | Service, with provider pointing to your business @id |
| Blog posts | Article or BlogPosting, with author and dates |
| FAQ sections | FAQPage, matching the visible questions and answers |
| Products | Product with Offer, if you sell online |
Note that Google shows FAQ rich results only for a limited set of authoritative sites, but clear question-and-answer markup still helps other search and AI tools understand the page.
Validate everything with Google's Rich Results Test and the Schema Markup Validator at validator.schema.org. Prompt for Claude:
Add JSON-LD to every page: LocalBusiness (type Plumber) with the details in CLAUDE.md on the home and contact pages, BreadcrumbList on every page, Service on each service page and BlogPosting on posts. Only describe content that is visible on the page. Then list each page and the schema it outputs.
Step 7: Open Graph and social previews
Open Graph tags control how links look when shared in messages, social posts and many AI chat interfaces:
<meta property="og:type" content="website">
<meta property="og:title" content="Emergency plumbing in Naperville">
<meta property="og:description" content="24/7 emergency plumbers serving Naperville and Aurora.">
<meta property="og:url" content="https://acmeplumbing.com/emergency-plumbing">
<meta property="og:image" content="https://acmeplumbing.com/og/emergency-plumbing.jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
Use an absolute image URL, 1200 by 630 pixels, and a unique image per key page where you can. Test with the sharing debuggers from Facebook and LinkedIn, or by pasting the link into a private chat.
Step 8: Google Search Console
- Go to Google Search Console and add a Domain property (covers http, https, www and subdomains).
- Verify by adding the TXT record Google gives you at your DNS provider. See domains, DNS, SSL and email authentication.
- Open Sitemaps and submit your sitemap URL.
- Use URL Inspection on your home page and key service pages, and request indexing.
- Over the next weeks, check Pages for anything excluded and Performance for the searches you appear in.
Step 9: Bing Webmaster Tools
- Sign in to Bing Webmaster Tools and choose Import from Google Search Console to bring over your verified site and sitemap, or add the site manually and verify by DNS.
- Confirm the sitemap is listed under Sitemaps.
- Consider IndexNow, a protocol supported by Bing and several other engines (not Google) that lets your site notify them when pages change. On a coded site, Claude can add a small build step that submits changed URLs; on WordPress, some SEO plugins handle it.
Bing's index powers Bing search and Microsoft's Copilot experiences, so it is worth the few minutes.
Step 10: re-check after every build
AI-generated changes can quietly break SEO: a new page with a copied title, a removed canonical, schema that no longer matches the page. Add a short checklist to your CLAUDE.md so Claude checks titles, descriptions, canonicals, schema and the sitemap on every change, and re-validate key pages monthly. Our security guide for AI-built sites is a good companion checklist.
The short version
Make pages readable HTML, give each a unique title, description and canonical, publish robots.txt, a sitemap and llms.txt, describe your business with LocalBusiness and supporting schema, add Open Graph tags, and submit the sitemap to Google Search Console and Bing Webmaster Tools. If your site runs on WordPress instead, see Yoast features most sites never use. Want us to audit your AI-built site? Send us the link.
Questions people ask
Do AI-built websites rank in Google?
What schema should a local business website have?
Do I need both Google Search Console and Bing Webmaster Tools?
Does llms.txt help my site appear in ChatGPT or Claude?
What size should my Open Graph image be?
Planning a website?
Get a platform recommendation and a fixed quote within one business day.



