| 开发者 | sasiddiqui |
|---|---|
| 更新时间 | 2026年12月4日 18:53 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/llms.txt, a Markdown index of your pages. Write your own text instead, or put it above the generated list./llms-full.txt, the Markdown of every page in one file.robots.txt that point to these files..md version of every page, for example /about.md. The homepage is /index.md.llms.txt. When empty it uses the meta description of the page, then the excerpt. The page content is never used.?p=123 are not supported: no Markdown pages or llms.txt are served, and the settings page shows a notice.
How it works
When an agent requests /about.md, AgentWelcome reads the public page /about/ the same way a visitor would, keeps the main content, removes navigation, scripts and forms, and converts the result to Markdown with a short metadata header. Each Markdown response carries a canonical link to the HTML page and a noindex header, so search engines do not treat it as duplicate content.
Stored Markdown
The generated Markdown is stored in its own database table and refreshed in the background when you save a page, and the blog page also when a post changes. You can regenerate or clear it from the settings page, the edit screen, the post lists and WP-CLI.
Source code
The source code, the tests and the issue tracker are on GitHub: https://github.com/samiahmedsiddiqui/agentwelcome
/wp-content/plugins/agentwelcome, or install it from the Plugins screen./llms.txt and any page URL with .md added to check the output, or use AgentWelcome > Verify & Preview.A plain text file at /llms.txt that lists the pages of your site with a short description, written in Markdown for AI tools to read. AgentWelcome builds it for you and also serves a Markdown version of each page at its address plus .md.
No. Nothing guarantees that. These tools decide for themselves whether to read llms.txt, and AgentWelcome cannot make them. It only makes your content easy to read for the ones that do.
Add .md to the page URL without the trailing slash: /about/ becomes /about.md and /services/web/ becomes /services/web.md. The homepage is /index.md. /about/index.html.md, /about/index.md and /index.html.md also work. You can choose /index.html.md as the homepage URL under AgentWelcome > Settings > Content > Homepage; the chosen one is listed in llms.txt.
Yes: /blog/page/2.md returns the Markdown of /blog/page/2/, for the blog page and for any page that links to its own /page/2/. A number beyond the last page gets a 404. llms.txt lists the list page once, not each of its pages. When a list loads its pages another way, return the number of pages from the agentwelcome_page_count filter.
The page is not published, is password protected, belongs to an excluded post type, is hidden in the editor, matches an exclusion rule, is set to noindex by an SEO plugin, or has no pretty permalink. Verify & Preview tells you which.
Yes. Pages, posts and custom post types that have a custom URL set by the Custom Permalinks plugin get their .md version at that URL plus .md, for example /company/about-us.md. A request for the original WordPress URL plus .md, for example /about.md, is redirected to it. Pages with default WordPress permalinks work as usual.
A real llms.txt file in the site root, for example one written by Yoast SEO, is served by the web server before WordPress runs. See "I already have an llms.txt file on my server" below.
No. AgentWelcome reads the page as the server sends it, so text, products or lists that a script adds after the page loads are not in the Markdown.
WPML and Polylang are supported when each language has its own directory (such as /ar/) or its own domain. Every translation has its own Markdown address (/ar/about.md, /ar/index.md), and the one /llms.txt at the root lists the default language first, then each other language. A page without a translation gets a 404 under that language. Addresses that add the language as a query argument (?lang=ar) are not supported. When Polylang takes the language from the content, so that addresses do not show it, llms.txt is not grouped by language.
No. Pages that use ?p=123 style URLs are never converted. Choose another structure in Settings > Permalinks.
It only runs on production by default. Open AgentWelcome > Settings > Environment and tick your environment, or define WP_ENVIRONMENT_TYPE as production. To limit it to certain domains, set "Allowed URLs", or define AGENTWELCOME_ALLOWED_URLS in wp-config.php. define( 'AGENTWELCOME_ENABLED', false ); switches it off completely.
Hook into the agentwelcome_markdown_updated action, which runs with the post ID and the Markdown address when a page's stored Markdown changes or is removed, and agentwelcome_cache_cleared, which runs once when every stored copy is cleared. Call your host's or CDN's purge from them. An example is in docs/hooks.md in the GitHub repository.
The cart, checkout, My account and terms pages are left out, because they are different for each visitor. The shop page and products are included. The agentwelcome_woocommerce_excluded_pages filter changes the list.
Open AgentWelcome > Verify & Preview, enter the page address and press Check page. It builds fresh Markdown from the live page and tells you whether the stored copy is in sync, shows a preview and the changes, and checks that the text on the page is in the Markdown. If the copy is out of date, press Update stored copy. The All pages tab does the same check for every stored page in the background and lists the ones that differ. If your site disables WP-Cron, that tab runs the scan itself while it stays open.
Your host, a CDN or the browser may be keeping the file for a few minutes. AgentWelcome allows 5 minutes. Add a query string to the address, for example /about.md?t=123 or /llms.txt?t=123, to skip that cache. Also check that the page was saved: it is refreshed in the background a few seconds after saving.
AgentWelcome remembers a hash of your site address. When the address changes, as on a staging copy or after a move to a new domain, it pauses so a copy does not serve Markdown and llms.txt to AI agents. A banner on its pages has a "Resume on this address" button for administrators. If you set AGENTWELCOME_ALLOWED_URLS in wp-config.php, that overrides this check. Developers can turn it off with the agentwelcome_check_site_address filter.
Yes. Open AgentWelcome > llms.txt and choose Custom to serve exactly your text, or Hybrid to serve your text followed by the list of pages AgentWelcome builds. You can type the text or load it from a .txt or .md file. Automatic keeps the generated file.
An optional file with the Markdown of every page in one place, for agents that prefer a single download. Turn it on under AgentWelcome > llms.txt. It has the same modes as llms.txt (Automatic, Custom and Hybrid) with its own text. It uses the stored copies, so generate any missing pages first. It stops at 5 MB and says how many pages were left out.
A real file in the site root is served by the web server before WordPress runs, so AgentWelcome cannot replace it. The llms.txt page shows a notice when it finds llms.txt or llms-full.txt there. Delete or rename the file to use the one AgentWelcome generates.
It adds comment lines that point to llms.txt (and llms-full.txt when it is on). They add no allow or disallow rules. It does nothing if a real robots.txt file exists on the server or if the site asks search engines not to index it.
Pages refresh in the background when you save them. To refresh by hand use "Regenerate now" in the AgentWelcome box on the edit screen, "Regenerate all" or "Clear cache" on the settings page, the "Regenerate Markdown" action in the post lists, or wp agentwelcome cache regenerate --all.
Administrators, through the agentwelcome_manage_files capability that they get automatically. You can give that capability to any role or user with a role editor plugin, and those users see a menu with the llms.txt page only. Settings, Verify & Preview and the cache buttons stay with administrators. A tool that signs in with an application password can read and change the same settings through the REST API, for a user who has that capability. Editors can still hide a page or set its description on the edit screen of pages they can edit.
Use the REST route /wp-json/agentwelcome/v1/llms. Create a user, give only that user the agentwelcome_manage_files capability (for example with wp user add-cap USERNAME agentwelcome_manage_files, or with a role editor plugin), and create an application password for it under Users > Profile. Then send a GET request to read the settings, or a POST request with mode, custom, full, full_mode, full_custom or robots_line to change them. Fields you do not send keep their value. A 200 response means it works, a 403 means the user does not have the capability, and a 401 means the login is wrong. Do not upload a real llms.txt file to the server for this, because the web server would serve it instead of the plugin.
The stored Markdown table is always removed, and so are any saved HTTP Basic credentials. Your other settings and the choices saved on pages are removed only if you tick "Delete all data on uninstall" on the Environment tab. The llms.txt capability is removed from all roles and users in the same case.
Tick "This site is protected with HTTP Basic authentication" in AgentWelcome > Settings and enter the credentials. They are stored encrypted and only sent to your own site. You can also define AGENTWELCOME_HTTP_AUTH_USER and AGENTWELCOME_HTTP_AUTH_PASSWORD in wp-config.php.
Save the credentials in AgentWelcome > Settings > Rendering > Site access. AgentWelcome then sends them with the page request and with WordPress's own background request, so scheduled refreshes run. Without them, WP-Cron cannot reach the site.
AgentWelcome keeps the last Markdown it read from the page and tries again later. For a page it has not read yet, it falls back to the post content. That output is thinner, because fields printed by your theme are missing. Verify & Preview shows when this happens and why.
If the page says noindex, AgentWelcome leaves it out by default. It reads the robots meta tag and the X-Robots-Tag header of the page, so a post type that your SEO plugin sets to noindex is left out too. The AgentWelcome box on the edit screen and Verify & Preview say so. To include such pages, untick "Leave out pages set to noindex" under AgentWelcome > Settings > Content > Exclusions.
If visitors cannot read the page, AgentWelcome leaves it out as well. This is the case when a membership or access-control plugin answers a logged-out visitor with HTTP 401 or 403, or sends the visitor to a login page. Verify & Preview and the edit screen box give the reason. To include such pages, untick "Leave out pages that visitors cannot read" under AgentWelcome > Settings > Content > Exclusions, or return false from the agentwelcome_is_restricted filter for a single page.
A page that has not been generated yet is not listed either. After an install or an update the plugin generates every page in the background, so the list fills in over a few minutes.
Yes. Switching the theme, updating the active theme, saving the Customizer, saving an ACF options page or saving an Elementor saved template marks the stored Markdown out of date and rebuilds it in the background. Saving a page in Elementor refreshes that page. Activating, deactivating or updating other plugins only shows a notice, because those are frequent; use Verify & Preview > All pages to see whether anything drifted.
Yes. Use the agentwelcome_is_eligible filter to leave out a single post, agentwelcome_excluded_post_types to leave out post types, and agentwelcome_show_meta_box to hide the box on the edit screen. Examples are in the plugin's GitHub README.
Yes. Untick "Show the AgentWelcome box on the edit screen" in AgentWelcome > Settings. This also hides the sidebar panel of the block editor. Anything already saved on a page, such as hiding it or its description, keeps working.
Yes. Set the content selector in AgentWelcome > Settings. The default tries main, [role="main"], #content, #main, .site-content and article, then the whole body.
Yes. Add CSS selectors, one per line, under "Elements to exclude". They are removed in addition to the built-in list (navigation, sidebars, forms, scripts, hidden elements, and any site-level header or footer). Headers and footers inside an article are kept. Verify & Preview lets you try selectors without saving them.
Developed with AI coding tools and maintained by Sami Ahmed Siddiqui. Every change is reviewed by the author and checked with automated tests, PHPCS, PHPStan and Plugin Check before release.
agentwelcome_list_pages filter./page/2/ and later of a list page, the Markdown link in the head points to that page instead of the first one, and the blog page now has the link too.Accept: text/markdown./blog/page/2/, are available as Markdown at /blog/page/2.md, each stored and refreshed on its own.agentwelcome_is_restricted filter include them.Accept: text/markdown.agentwelcome_markdown_updated and agentwelcome_cache_cleared, so a host or CDN cache can be purged when the Markdown changes..md address that is not served now gets a plain text 404 from the plugin, so another plugin or a host rule can no longer redirect it to the homepage.agentwelcome_render argument into the Markdown.