Expose /llms.txt via plugin or code, inject JSON-LD for Product, FAQ, and Article, and verify AI crawler access. Benchmarks show top sites like Supabase and Cloudflare score 100/100 with these basics.
Direct answer: To optimize WordPress for AI search in 2026, create and expose an
/llms.txtfile, inject JSON-LD structured data (Product, FAQ, Article), and ensure AI crawlers like GPTBot and OAI-SearchBot are allowed in robots.txt. These steps form the foundation of Generative Engine Optimization (GEO).
Why AI Crawlers Need More Than SEO
AI search engines rely on structured, machine-readable content. Our 2026 benchmark of 200 sites shows a clear divide: sites with /llms.txt, JSON-LD, and server-side rendering (SSR) consistently score 100/100 (Grade S), while those missing these elements score as low as 44/100 (Grade D). For example, Supabase, Cloudflare, Resend, and Mintlify all achieve 100/100 with these basics in place, despite TTFB ranging from 1554ms to 2917ms. Perplexity, lacking /llms.txt and JSON-LD, scores only 44/100. WordPress sites often lag because plugins rarely address AI crawler needs out of the box.
Step 1: Create and Expose /llms.txt
The /llms.txt file is a plain-text manifest that tells AI crawlers what content is available and how to access it. It should be placed at the root of your domain (e.g., https://example.com/llms.txt).
Option A: Use a plugin
- Install and activate a plugin like LLMS.txt Generator (available in the WordPress repository). Configure it to include key pages and posts.
- Alternatively, use a general SEO plugin such as Yoast SEO (v22+) or Rank Math (v1.0.100+), which now offer
/llms.txtgeneration in their premium tiers.
Option B: Manual code
Add the following to your theme's functions.php or a custom plugin:
add_action('init', function() {
add_rewrite_rule('^llms\.txt$', 'index.php?llms_txt=1', 'top');
});
add_filter('query_vars', function($vars) {
$vars[] = 'llms_txt';
return $vars;
});
add_action('template_redirect', function() {
if (get_query_var('llms_txt')) {
header('Content-Type: text/plain; charset=utf-8');
echo "# llms.txt\n\n";
echo "> https://example.com\n\n";
echo "## Main Pages\n";
echo "- [Home](https://example.com/)\n";
echo "- [Blog](https://example.com/blog/)\n";
exit;
}
});
After adding, flush permalinks (Settings > Permalinks > Save). Test by visiting https://example.com/llms.txt.
Step 2: Inject JSON-LD Structured Data
JSON-LD helps AI understand your content's entities and relationships. Implement at least these schema types:
- Product for e-commerce pages
- FAQPage for Q&A sections
- Article for blog posts
Option A: Plugin
- Yoast SEO (free) automatically adds Article schema; premium adds FAQ and Product blocks.
- Rank Math (free) supports Article and FAQ; Product schema requires WooCommerce.
- Schema Pro (premium) offers all three with a visual builder.
Option B: Manual code
Add to functions.php:
add_action('wp_head', function() {
if (is_singular('post')) {
$schema = [
'@context' => 'https://schema.org',
'@type' => 'Article',
'headline' => get_the_title(),
'datePublished' => get_the_date('c'),
'author' => ['@type' => 'Person', 'name' => get_the_author()],
];
echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
}
if (is_product()) {
global $product;
$schema = [
'@context' => 'https://schema.org',
'@type' => 'Product',
'name' => $product->get_name(),
'description' => $product->get_short_description(),
'sku' => $product->get_sku(),
'offers' => [
'@type' => 'Offer',
'price' => $product->get_price(),
'priceCurrency' => get_woocommerce_currency(),
'availability' => 'https://schema.org/InStock',
],
];
echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
}
});
For FAQ, use a plugin or manually add a JSON-LD block in the page editor.
Step 3: Test AI Crawler Accessibility
Ensure your robots.txt allows GPTBot and OAI-SearchBot. Add these lines:
User-agent: GPTBot
Allow: /
User-agent: OAI-SearchBot
Allow: /
Use the free WorkAgent GEO Audit to check your site's AI readiness score, /llms.txt presence, JSON-LD validity, and crawler access. It also reports TTFB and SSR status.
Plugin vs. Manual: Decision Table
| Criterion | Plugin (Yoast/Rank Math) | Manual Code |
|---|---|---|
| Ease of setup | High (GUI) | Medium (coding) |
| Flexibility | Limited to plugin features | Full control |
| Performance impact | Minimal | Minimal |
| Maintenance | Auto-updates | Manual updates |
| Cost | Free/Premium | Free |
| Best for | Non-technical users | Developers |
Scope and Limitations
This guide covers the technical basics of GEO for WordPress. It does not guarantee improved AI rankings, as AI algorithms are opaque and evolving. Results depend on content quality, authority, and other factors. Always test changes in a staging environment.
For a quick assessment of your site's current GEO readiness, try the free audit tool: WorkAgent GEO Audit.
๐ Check in 30 Seconds: Does ChatGPT, Perplexity or Claude Recommend Your Brand โ or Your Competitor?
WorkAgent GEO powers 6,981+ verified crawls across all 7 major AI & search bots and a live 200-company ร 20-industry AI benchmark on $0 paid ads. Scan free in 30s, unlock your tailored 9-file Fix-Code Pack & Executive PDF ($19), download our 200-Company Excel CSV dataset ($49), start hands-free with our $29 Auto-Launch Pack or $99/mo Autopilot (5 articles/wk), embed our $29/mo Live Audit API, or book our 7-Day Autonomous AI Visibility Launchpad ($199 / $399).
๐ WorkAgent GEO Free 30-Second AI Crawler Audit ยท Check AI Citations (No Signup Required)
- ๐ Originally published on WorkAgent GEO Canonical Research
Top comments (0)