serkanalgur/markdown-content-negotiator-for-llms
Composer 安装命令:
composer require serkanalgur/markdown-content-negotiator-for-llms
包简介
Detects Accept: text/markdown and serves pre-generated Markdown versions of posts/pages for AI agents.
README 文档
README
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/markdownand 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
- Clone or download this repository.
- Upload the folder to your
wp-content/plugins/directory. - Activate the plugin in the WordPress Admin.
- 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
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+
serkanalgur/markdown-content-negotiator-for-llms 适用场景与选型建议
serkanalgur/markdown-content-negotiator-for-llms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 3, 最近一次更新时间为 2026 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 serkanalgur/markdown-content-negotiator-for-llms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 serkanalgur/markdown-content-negotiator-for-llms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-03-04
