TLDR WP
AI-powered post summaries using the WordPress AI Client.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/jasonyingling/tldr-wp/archive/refs/heads/main.zipA dynamic TL;DR block for post templates and individual posts, with editable blurbs generated by the native WordPress AI Client. Requires WordPress 7.0+, PHP 7.4+, and a configured text-generation provider.
Install and use
- Copy this directory into
wp-content/plugins/tldr-wpand activate TLDR WP. - Install an AI provider plugin and configure its credentials in Settings → Connectors.
- Open a post in the block or classic editor. In TLDR summary, click Generate summary.
- Review or edit the generated draft, then save/update the post to persist it.
- In Appearance → Editor → Templates → Single Posts, insert TL;DR above Post Content and save the template. Each post using that template displays its own saved summary. Alternatively, insert the block directly into an individual post.
Use the block’s settings to change or hide its label, and use WordPress design controls for colors, typography, spacing, and alignment. In the Site Editor, an instructional placeholder appears when there is no preview post or summary. On the website, posts without summaries show nothing. Avoid placing the block in both a template and its post content unless you want it displayed twice.
Generation never automatically changes the excerpt or publishes text. Adding a template block does not generate summaries for existing posts: generate and review each post’s blurb first. Rendering is server-side HTML and never calls AI.
GEO approach
Blurbs lead with the main answer or finding, name their subject explicitly, preserve supported facts and qualifications, and stand on their own when quoted. No invented citations, keyword stuffing, hidden AI-only content, or special schema is added. This makes the summary useful to readers and suitable for extraction, but does not guarantee search rankings or AI citations. See Google’s guidance on generative AI search.
Programmatic placement
In a PHP theme template, place this above the post content:
echo tldr_wp_render_summary( get_the_ID() );
// Optional custom label; an empty label hides it.
echo tldr_wp_render_summary( get_the_ID(), array( 'label' => 'Key takeaway' ) );
The function returns escaped HTML or an empty string and respects post visibility and password protection. Theme authors can style .tldr-wp-summary. The [tldr_wp] shortcode remains available as a compatibility option. Block templates can use ``.
Generation uses the current editor content, including unsaved edits. The initial scope is standard posts. Summaries live in _tldr_wp_summary post metadata. Removing the plugin preserves existing summaries.
Article text is sent to the provider configured by the site administrator only when generation is requested. Provider charges and data policies apply. This plugin stores no API keys. Requests require permission to edit the specific post, accept at most 60 KB of source text, and share a 30-second per-user cooldown. Review AI output for accuracy before saving. The limit is a basic cooldown, not a billing quota.
API and optional MCP
POST /wp-json/tldr-wp/v1/posts/<id>/summary accepts an optional content string; omission uses the saved post. It returns { "summary": "…" }. Use authenticated WordPress REST requests (including a REST nonce for cookie authentication).
The tldr-wp/summarize-post ability accepts { "post_id": 123 }, summarizes saved content, and returns a draft without saving it. It uses the same permissions, limits, and generation service. MCP exposure is disabled by default. To enable it, install the official MCP Adapter plugin and add this in a site-specific plugin:
add_filter( 'tldr_wp_enable_mcp', '__return_true' );
The adapter’s authenticated default server can then discover and execute the ability. A public MCP metadata flag means discoverable through that server; it does not grant anonymous access. See the MCP evaluation for tradeoffs and connection details.
Development
There is no build step or bundled AI SDK.
php tests/generation.php
node --check assets/editor.js
node --check blocks/tldr/editor.js
docker compose -p tldr-wp-test -f tests/compose.yml up --abort-on-container-exit --exit-code-from cli
docker compose -p tldr-wp-test -f tests/compose.yml down -v
The integration suite downloads WordPress 7.0 into a disposable container volume. It checks native AI Client compatibility, permissions, REST validation, ability registration, saving, shortcode privacy, block context, and programmatic rendering. Isolated provider tests cover successful generation, failure responses, sanitization, and cooldowns without paid requests. Live provider generation and browser editor behavior also require manual verification on a configured site.
References
License: GPL-2.0-or-later.