How to Add an llms.txt File to Your WordPress Site

· 7 min read · 6 views · Getwebup

If ChatGPT, Perplexity, or Google's AI Overviews are quoting your competitors instead of you, part of the problem might be that your site has no clean, machine-readable summary for them to read. That's what an llms.txt file is for — and setting one up takes about fifteen minutes.

What llms.txt actually is

An llms.txt file is a small Markdown file at the root of your domain — https://yourdomain.com/llms.txt — that gives AI models a curated, plain-text map of your site: who you are, what your key pages are, and links to the content that matters most. Think of it as a sitemap.xml, but written for language models instead of search engine crawlers.

It's not an official web standard and no AI company has committed to reading it the way Googlebot reads robots.txt. But since the proposal landed in late 2024, it's been adopted fast enough — by frameworks, SaaS docs sites, and increasingly WordPress and SEO plugins — that having one costs you nothing and might help. Worst case, it's a well-organized summary of your own site that's useful to you too.

llms.txt vs robots.txt vs sitemap.xml — don't confuse these

FilePurposeAudience
robots.txtTells crawlers what they're allowed to fetchSearch bots, AI crawlers (GPTBot, ClaudeBot, etc.)
sitemap.xmlLists every URL for indexingSearch engines
llms.txtSummarizes your site in plain language for an LLM to readAI models answering user questions

They do different jobs and don't conflict. If you've already set up rules to block aggressive AI crawlers from hammering your server, llms.txt is the opposite move — you're inviting the AI in, just handing it a cleaner version of your site instead of making it scrape every page.

Symptom: AI answers skip your business entirely

You Google your own niche in ChatGPT or ask Perplexity a question your blog post answers well, and your site never comes up — even though you rank on page one in regular search. A few root causes, roughly in order of how often we see them:

  • Your key pages are buried under navigation, cookie banners, and JS-rendered content the crawler can't parse cleanly.
  • There's no single, obvious page summarizing what your business does and what you're an authority on.
  • You're accidentally blocking AI crawlers in robots.txt or .htaccess (worth checking — see our post on AI crawlers overloading your server if you added rules there recently).
  • Nothing points the model at your best content specifically — it's guessing from whatever it managed to scrape.

llms.txt fixes the third problem directly and helps a lot with the first two, because writing it forces you to state, in one place, what your site is actually about.

Writing the file

The format is deliberately simple Markdown. Structure:

# Getwebup

> AI website builder and cloud/VPS hosting company based in India, offering
> managed WordPress hosting, cPanel VPS, and domain services.

Getwebup provides managed hosting, WordPress migrations, and VPS/cloud
infrastructure for businesses in India and internationally.

## Docs

- [Hosting Plans](https://yourdomain.com/hosting): Shared, VPS, and cloud plans compared
- [Migration Guide](https://yourdomain.com/migrate): How we migrate sites with zero downtime

## Blog

- [WordPress Troubleshooting](https://yourdomain.com/blog/category/wordpress): Fixes for common WP errors
- [cPanel Guides](https://yourdomain.com/blog/category/cpanel): Step-by-step cPanel tutorials

## Optional

- [Pricing](https://yourdomain.com/pricing): Current plan pricing

Rules that matter:

  • Start with a single H1 — your site or company name.
  • Follow with a one-line blockquote summary. This is the part most likely to get quoted verbatim, so make it count.
  • Group links under H2 sections. Use a section literally named Optional for pages that are useful but not essential — some parsers will trim this section first if they need to shorten the file.
  • Keep link descriptions short and factual, not marketing copy. Models weight plain description text more than adjectives.
  • Don't just dump your whole sitemap in here. Ten to thirty curated links beats three hundred auto-generated ones — the whole point is curation.

Publishing it on Getwebup hosting

Static site or plain HTML site (cPanel File Manager)

  1. Log in to cPanel and open File Manager.
  2. Navigate to public_html (or the document root for the specific domain, if it's an addon domain).
  3. Click + File, name it llms.txt, and open it in the code editor.
  4. Paste your Markdown content and save.
  5. Verify at https://yourdomain.com/llms.txt — it should load as plain text, not download or 404.

WordPress

WordPress doesn't serve arbitrary root-level files out of the box unless they physically exist in the site's document root, so you have two options:

Option A — drop the file directly (simplest, works everywhere): Same File Manager steps as above, placed in the same folder as your wp-config.php. No plugin needed, and it survives theme changes.

Option B — generate it dynamically with a snippet, useful if you want the file to stay in sync with your latest posts automatically:

// functions.php or a site-specific 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');
        $posts = get_posts(['numberposts' => 15, 'post_status' => 'publish']);
        echo "# " . get_bloginfo('name') . "\n\n";
        echo "> " . get_bloginfo('description') . "\n\n";
        echo "## Recent Posts\n\n";
        foreach ($posts as $p) {
            echo "- [" . get_the_title($p) . "](" . get_permalink($p) . ")\n";
        }
        exit;
    }
});

After adding the snippet, go to Settings → Permalinks and click Save once to flush rewrite rules, otherwise the URL will 404.

VPS with Nginx

Place the file in your site's root and make sure Nginx serves plain-text files with the right content type:

location = /llms.txt {
    root /var/www/yourdomain.com/public;
    add_header Content-Type text/plain;
}

Reload with sudo nginx -t && sudo systemctl reload nginx after editing.

Cause: why it doesn't show up even after you upload it

SymptomLikely causeFix
404 on /llms.txtUploaded to wrong document root (common with addon domains)Confirm the exact document root in cPanel → Domains, re-upload there
File downloads instead of displayingServer serving it with wrong MIME typeRename with lowercase .txt extension; on Nginx/Apache force text/plain
WordPress redirect loop or 404 (Option B)Rewrite rules not flushedRe-save Permalinks settings
Cloudflare caching stale contentPage Rule or cache-everything policy caching the .txt filePurge cache for that URL, or add a "bypass cache" rule for /llms.txt

Prevention: keep it useful, not just present

  • Review it quarterly. Stale links to discontinued products hurt more than having no file at all.
  • Don't block the crawlers you just invited. Check robots.txt for accidental Disallow: / rules under GPTBot, ClaudeBot, PerplexityBot, or Google-Extended — llms.txt is wasted if the crawler can't reach the pages it links to.
  • Keep the summary line accurate. It's the single sentence most likely to get lifted into an AI answer, so word it the way you'd want to be quoted.
  • Don't treat it as an SEO silver bullet. It supplements good content and clean HTML — it doesn't replace them. A site with thin, generic pages won't get better AI answers just because it has a tidy summary file pointing at them.

Quick checklist

  • File is named exactly llms.txt (lowercase) and sits at the domain root.
  • Loads as plain text at https://yourdomain.com/llms.txt, no login or redirect.
  • Starts with an H1 title and a one-line blockquote summary.
  • Links are curated, working, and use HTTPS absolute URLs.
  • robots.txt isn't blocking the AI crawlers you want reading those links.

Questions people actually ask