# [WordPress plugin](https://rebilder.com/docs/adapters/wordpress)

> Serve posts, pages and WooCommerce products as markdown from your WordPress site. The plugin is GPL-2.0-or-later; Console reporting is optional.

- **Updated:** 2026-09-08
- **Author:** Rebilder
- **Section:** Adapters
- **Description:** Serve posts, pages and WooCommerce products as markdown from your WordPress site. The plugin is GPL-2.0-or-later; Console reporting is optional.
- **Publisher:** Rebilder

## What it does

When a request for one of your pages carries `Accept: text/markdown`, the plugin answers with that page’s content as markdown instead of HTML. Same URL, same substance, different format. There is nothing to configure: activate it and it works. Connecting it to a Console is optional and separate. See below.

| Request | Response |
| --- | --- |
| A browser, or anything human-shaped | Untouched. WordPress renders the page. |
| Googlebot or bingbot, **even asking for markdown** | The canonical HTML. Always. |
| `Accept: text/markdown` | That page’s content as markdown, at the same URL |
| A known agent (ChatGPT-User, ClaudeBot, …) | Markdown |
| An unidentified agent that did not ask | HTML, because we never guess a format |
| `GET /llms.txt` | An index of your content |
| `GET /answers` (after an import, plugin 0.2.0+) | Your imported Q&A set: markdown for agents, HTML for people, FAQ data for both |

Posts and pages render with their title, publication and update dates, author, categories and tags, and the body. WooCommerce products render with name, price, availability, stock, SKU, categories and attributes.

## Install

Download the [WordPress plugin ZIP](/downloads/rebilder-wordpress-0.3.1.zip), then open Plugins → Add New → Upload Plugin in WordPress. Install the ZIP and activate Rebilder. Check a public page to confirm it is working:

```
curl -H "Accept: text/markdown" https://your-site.com/your-page/
```

You should get markdown. Loading the same URL in a browser is unchanged. Skip everything else and the plugin never makes a network request; the optional key in Settings → Rebilder is what turns reporting on.

## Connecting it to your Console

> **Connect reporting when you need it** Connect reporting in the plugin settings to send gateway events to your Console. Reporting stays off until an API key is configured.

To connect: issue a key in [Console → Settings](/console/settings), paste it into Settings → Rebilder in wp-admin, and press Connect. Saving makes one blocking request to check the key is live, so a typo tells you immediately instead of leaving you with an empty Console. Disconnect in the same place; the key is deleted and the plugin goes back to sending nothing. Uninstall deletes it too.

What is sent: at most one small record per page load, after the page has been delivered, as a non-blocking request whose reply is ignored. The record carries the time, the requested URL **with the query string stripped** except for `page`, `variant`, `sku`, `lang`, `locale` and `currency`, the `Accept` header, which agent it appeared to be (always unverified: the plugin parses the claim and never checks a signature), the referring site as an origin like `https://chatgpt.com` and never the full link, what was served, and the render time in milliseconds.

What is never sent: IP addresses, cookies, anything about a logged-in user, form contents, search terms, order or customer data, and your page content. **Nothing a visitor typed**. Query capture is excluded from the plugin’s reporting payload.

Search results pages are dropped entirely, and that is a second mechanism rather than the same one. WordPress writes a search two ways: `?s=<term>`, which the query allowlist removes, and the pretty permalink `/search/<term>/`, which it cannot, because `request.url` keeps the path verbatim and core registers that permastruct itself. So the plugin asks core’s own `is_search()` and returns before an event is built: no event rather than a redacted one. A search results page is not a document any site could have served markdown for, so the miss it would report is the same miss every time.

> **Understand WordPress reporting coverage** The plugin reports agent requests, crawler requests and AI-referred human visits. It excludes ordinary human pageviews. Read those request counts directly; add the Rebilder Tag when you also need browser pageview reporting.

Your store API key connects supported reporting and Answers operations for that store. Keep it private and rotate it in Console Settings when needed.

## Search crawler responses

> **Crawlers can never reach the markdown path** Googlebot and bingbot are identified before any other signal is examined, so they receive exactly the HTML a human receives, even if they send a markdown `Accept` header. This keeps crawler responses aligned with the HTML your visitors receive. Tests verify this classification order.

The detection tables are compared, mechanically, against `@rebilder/agent-detect`, the same tables the hosted gateway uses. Adding a pattern to one and not the other fails the build.

## Caching

> **Your cache must respect `Vary: Accept`** The plugin returns two different bodies for one URL depending on a request header, and sends `Vary: Accept` on every response to keep them apart. If your caching plugin or CDN strips or ignores `Vary`, the first response into the cache is the one everybody gets: one agent’s markdown served to every human, or one human’s HTML served to every agent. Configure it to vary on `Accept` for your pages.

## WordPress source values

Every value in the markdown is read from WordPress or WooCommerce. No AI model runs at any point. No price is recalculated, rounded, or estimated: WooCommerce’s own stored value is printed as-is with your shop’s currency, and a discount is only shown when WooCommerce says the product is on sale, because comparing the two numbers ourselves would be us deciding what is on sale.

Availability comes from `is_in_stock()`, WooCommerce’s own computed truth, rather than from inventory arithmetic. This keeps the availability response aligned with your storefront.

## Reporting and rendering details

- Use the scanner to check readability. The plugin serves your website content to agents and connects reporting to the Console.
- Review request reporting in the Console after connecting an API key in the plugin settings.
- The plugin verifies the key when you save it. If reporting later stops, check the key and confirm a test request reaches the Console.
- Markdown is rendered on request rather than pre-generated on save. It is always fresh and there is nothing to invalidate; for a human visitor the plugin reads two headers and gets out of the way.

Deeply nested markup is worth knowing about: PHP’s HTML parser refuses documents nested more than 256 elements deep, which a page-builder theme can genuinely produce. The plugin detects that case and falls back to the post’s plain text (formatting lost, words kept) rather than serving an empty body.