=== AJ Agent Crawl Optimizer === Contributors: ajmaurya Tags: ai, mcp, openapi, structured-data, llms-txt Requires at least: 5.5 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.0.0 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html Make your WordPress site legible to AI agents — Markdown negotiation, JSON-LD, OpenAPI, MCP server card, llms.txt, IndexNow, and more. == Description == **AJ Agent Crawl Optimizer** is a thin compatibility layer that teaches your site to speak the languages AI agents already use to discover and consume web content. It publishes machine-readable manifests at well-known URLs, serves clean Markdown when an AI requests it, and declares your AI-usage preferences — all without changing anything for human visitors. Each capability is a separate toggle under **Settings → AJ Agent Crawl Optimizer** and ships **opt-in** (everything starts off). On first activation, a one-time **Quick Setup wizard** suggests sensible defaults based on your environment (for example, it skips JSON-LD when an SEO plugin is detected so you don't get duplicate structured data). = Discovery — help agents find what your site offers = * **API Catalog** (RFC 9727) — `/.well-known/api-catalog` linkset advertising your REST API, plus a `Link: rel="api-catalog"` header on every response so agents discover it from any URL. * **MCP Server Card** (SEP-1649 draft) — `/.well-known/mcp/server-card.json` describing the site to MCP-aware agents. * **Agent Skills Index** (RFC v0.2.0) — `/.well-known/agent-skills/index.json` listing six skills (search, posts, pages, media, categories, tags) plus per-skill `SKILL.md` artifacts with verifiable sha256 digests. * **llms.txt** (per llmstxt.org) — `/llms.txt` curated, LLM-readable index of your top pages and recent posts, with a Discovery section auto-linking every other plugin endpoint. * **IndexNow** — non-blocking ping to Bing and Yandex on every post publish so search engines re-crawl within minutes. = Presentation — format content for agents = * **Markdown Negotiation** — when a request includes `Accept: text/markdown`, the page is served as clean Markdown with `X-Markdown-Tokens` for context budgeting. Browsers (which send `text/html`) are completely unaffected. * **JSON-LD Schema** — Schema.org structured data: WebSite, Organization, Article, BreadcrumbList, and auto-detected FAQPage. Logo resolved from your theme's custom logo or site icon. * **OpenAPI 3.0.3** — `/?format=openapi` returns a complete spec generated dynamically from `rest_get_server()`, including plugin-registered REST routes. * **WebMCP Tools** — registers four tools (search, posts, pages, site info) via `navigator.modelContext.provideContext()` for browsers that support the W3C WebMCP draft. = Declarations = * **Content-Signals** — appends a `Content-Signal: ai-train=no, search=yes, ai-input=no` directive to robots.txt declaring your AI-usage preferences (per contentsignals.org). Composes with Yoast/Rank Math/AIOSEO — their additions are preserved, our line lands at the very end. = Why use it = * **No conflicts with your SEO plugin.** JSON-LD auto-suppresses when Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework, Slim SEO, Squirrly SEO, Schema Pro, or SASWP is active. * **Multisite-aware.** Every endpoint also resolves at `/{subsite}/...` paths automatically. * **Cached.** OpenAPI is cached for a day, llms.txt for an hour, with proper invalidation on plugin activation, theme switch, post changes, and setting toggles. * **Performance-conscious.** Markdown handler runs at `PHP_INT_MAX` priority so it doesn't break object-cache flushes or Query Monitor. IndexNow pings are non-blocking. * **Extensible.** Nine filter hooks let you customize skills, schemas, capabilities, and content. See "For Developers" below. * **Accessible.** Score-card SVG has dynamic `aria-label`, copy buttons announce success via `aria-live`, decorative arrows hidden from screen readers via CSS pseudo-elements. = For developers = The plugin exposes nine filter hooks for extension. Examples: `add_filter( 'ajaco_required_capability', function () { return 'edit_posts'; } );` Delegate plugin access to a non-admin role. `add_filter( 'ajaco_skill_definitions', function ( $skills ) { return $skills + [ 'products' => [ 'type' => 'information-retrieval', 'description' => 'WooCommerce products', 'endpoint' => rest_url( 'wc/v3/products' ) ] ]; } );` Register custom skills that ship in the Agent Skills Index and are served as SKILL.md artifacts with verifiable sha256 digests. `add_filter( 'ajaco_content_signal', function () { return 'ai-train=yes, search=yes, ai-input=yes'; } );` Customize the Content-Signal directive (e.g. permit AI training). Other hooks: `ajaco_api_catalog_linkset`, `ajaco_mcp_server_card`, `ajaco_json_ld_graph`, `ajaco_openapi_spec`, `ajaco_llms_txt_content`, `ajaco_active_seo_plugin`. The settings page's Help tab → For Developers lists all of them with descriptions. == Installation == = From the WordPress plugin directory = 1. In your WP admin, go to **Plugins → Add New** and search for "AJ Agent Crawl Optimizer". 2. Click **Install Now**, then **Activate**. 3. The Quick Setup wizard runs automatically on first activation — review the recommended toggles and click **Apply**. 4. Adjust any toggle later from **Settings → AJ Agent Crawl Optimizer**. = Manual install = 1. Download the plugin zip. 2. Upload the `aj-agent-crawl-optimizer` folder to `/wp-content/plugins/`. 3. Activate **AJ Agent Crawl Optimizer** from the **Plugins** screen. 4. Visit **Settings → AJ Agent Crawl Optimizer** and run the wizard or configure manually. = IndexNow setup (optional) = If you want Bing and Yandex to re-crawl your content within minutes of publish: 1. Generate a key at https://www.bing.com/webmasters/indexnow. 2. Paste it into the **IndexNow API Key** field on the settings page. 3. Enable the IndexNow toggle. The plugin hosts the key file at `/{key}.txt` for ownership verification automatically. == Frequently Asked Questions == = Will this conflict with my SEO plugin? = No. JSON-LD output auto-suppresses when Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework, Slim SEO, Squirrly SEO, Schema Pro, or SASWP is active. The settings page shows a clear notice when this happens. Our `robots_txt` filter runs at `PHP_INT_MAX` priority, so any rules your SEO plugin adds (sitemap URLs, custom Disallow, etc.) are preserved — our `Content-Signal` line is appended last. = Does this change anything for my regular site visitors? = No. Browsers send `Accept: text/html` and get the normal HTML response. The `.well-known/...`, `/llms.txt`, and `?format=openapi` endpoints are paths a normal user never visits. The only thing added to the page HTML is a single JSON-LD `