serkanalgur/markdown-content-negotiator-for-llms

Detects Accept: text/markdown and serves pre-generated Markdown versions of posts/pages for AI agents.

Maintainers

Package info

github.com/serkanalgur/markdown-content-negotiator-for-llms

Type:wordpress-plugin

pkg:composer/serkanalgur/markdown-content-negotiator-for-llms

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.1.0 2026-03-06 06:57 UTC

This package is auto-updated.

Last update: 2026-03-06 06:58:26 UTC


README

WordPress Packagist Version WordPress Plugin Version WordPress Plugin Stars PHP GitHub Release WordPress Plugin Downloads

Logo

Markdown Content Negotiator for LLMs

A WordPress plugin that detects when a request is made for content in Markdown format (via the Accept: text/markdown header) and serves a clean, pre-generated Markdown version of the page instead of HTML.

🚀 Features

  • Content Negotiation: Detects Accept: text/markdown and bypasses the standard theme template.
  • YAML Frontmatter: Automatically prepends metadata (Title, Date, Author, Categories, Permalink).
  • Automated Caching: Uses WP-Cron to pre-generate Markdown for all published posts and pages to minimize response time.
  • LLM-Friendly Headers:
    • X-Markdown-Tokens: Estimates token count using standard heuristics.
    • X-Content-Signal: Provides document metadata (type, depth, priority) and custom signals.
  • Customizable: Admin settings page to select Post Types and configure global content signals.

📥 Installation

  1. Clone or download this repository.
  2. Upload the folder to your wp-content/plugins/ directory.
  3. Activate the plugin in the WordPress Admin.
  4. Go to Settings > AI Markdown to configure your settings.

🛠 Usage

To request the Markdown version of a post, include the appropriate header in your HTTP request:

curl -H "Accept: text/markdown" https://yourdomain.com/your-post/

Response Example

---
title: "Hello World"
date: "2026-02-20 12:00:00"
author: "Serkan Algur"
permalink: "https://yourdomain.com/hello-world/"
categories: ["Uncategorized"]
---

# Hello World

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

⚙️ Configuration

Available under Settings > AI Markdown:

  • Enabled Post Types: Select which post types (post, page, etc.) should be available in Markdown.
  • X-Content-Signal Extra: Add custom global signals like ai-train=yes, search=yes.
  • Manual Regeneration: Trigger a full cache refresh for all posts.

Screenshot

Settings Page Screenshot

Changelog

1.1.0

  • Added WooCommerce Product support.
  • Added Elementor content rendering support.
  • Improved WooCommerce product data extraction (dimensions, weight, price with currency).
  • Moved product templates to internal code-based generation.
  • Fixed Markdown output escaping issues.

1.0.9

  • Support for WooCommerce Products.
  • Added product-specific Markdown templates.
  • Better metadata extraction for e-commerce sites.

1.0.8

  • Misspelling fix

1.0.7

  • Refactor avoid trademark of 'WP'

1.0.5

  • Name Change & Refactor plugin

1.0.4

  • Security: Implemented Late Escaping for all echoed variables and generated data.
  • Security: Added nonces and strict data sanitization for admin settings.
  • Standards: Full compliance with WordPress PHP Coding Standards (WPCS).
  • Refactor: Added complete Docblock documentation and standardized all hook callbacks.

1.0.3

  • Ability to generate markdown when post changes.

1.0.2

  • Featured Image support
  • Description creation

1.0.1

  • Code Block Conversion Support (pre and code)

1.0.0

  • Inital Release

📝 License

GPL-2.0+