AI-powered editorial review for the WordPress block editor. Redline checks post content against your Content Guidelines using the WP AI Client, then leaves inline Notes on blocks where issues are found.
Redline adds a sidebar panel to the Gutenberg editor. When you click Check Content, the plugin:
- Saves the post so the server has the latest content
- Parses all blocks server-side via
parse_blocks(), filtering to content blocks (paragraphs, headings, lists, quotes, buttons, images) - Runs free lint checks first using the Content Guidelines plugin's
Lint_Checker— catches vocabulary and readability issues at zero AI cost - Sends a batched AI prompt with all block contents + your merged guidelines via
wp_ai_client_prompt(), requesting a structured JSON response of issues per block - Merges lint + AI results and creates WordPress Notes (
comment_type='note') on each flagged block - Refreshes the editor so Notes appear inline on blocks immediately
The sidebar displays a summary of all issues grouped by block, with severity indicators (error/warning/info) and source labels (Lint vs AI).
[Sidebar: Check Content]
|
v
JS: POST /wp-json/redline/v1/check { post_id }
|
v
PHP: parse_blocks() → filter content blocks
PHP: wp_get_content_guidelines_for_post() → guidelines
PHP: Lint_Checker::check() per block (free)
PHP: wp_ai_client_prompt() → batched AI review → JSON
PHP: wp_insert_comment(type='note') on flagged blocks
PHP: Return results to JS
|
v
JS: Display results in sidebar
JS: Refresh editor to show inline Notes
| Dependency | Version | Purpose |
|---|---|---|
| WordPress | 6.9+ | Block-level Notes support |
| Content Guidelines | latest | Provides editorial guidelines, vocabulary rules, and the Lint_Checker |
| WP AI Client | latest (or WP 7.0+) | Provider-agnostic AI API (wp_ai_client_prompt()) |
| PHP | 8.1+ | Language features (union types, enums) |
| Node.js | 18+ | Build tooling via @wordpress/scripts |
Users need both:
edit_post— standard post editing permissionprompt_ai— WP AI Client capability for AI access
-
Install and activate the Content Guidelines plugin and configure your editorial guidelines (vocabulary rules, copy rules, etc.)
-
Install and activate the WP AI Client plugin and configure an AI provider (e.g., add your Anthropic or OpenAI API key in Settings)
-
Clone this repo into your plugins directory:
cd wp-content/plugins git clone https://github.com/alansmodic/redline.git -
Install dependencies and build:
cd redline npm install npm run build -
Activate Redline in the WordPress admin under Plugins
- Open any post or page in the block editor
- Invoke Redline via any of these methods:
- Command Palette — press
Cmd+K(orCtrl+K), type "Redline", select Redline: Check Content Against Guidelines - Three-dot menu → Plugins → Redline to open the sidebar panel
- Sidebar icon — once opened, the Redline icon stays in the sidebar toolbar
- Command Palette — press
- Click Check Content in the sidebar panel
- Review results in the sidebar — each flagged block shows its issues with severity and guideline section references
- Click on inline Notes in the editor to see detailed issues per block
- Use Clear All Notes to bulk-remove all Redline-created notes when done
redline/
├── redline.php # Main plugin file, bootstrap, dependency checks
├── includes/
│ ├── class-rest-controller.php # REST API: POST /redline/v1/check, /redline/v1/clear
│ ├── class-block-checker.php # Core: parse blocks, lint, AI prompt, merge results
│ └── class-note-creator.php # Creates WP Notes on blocks, updates block metadata
├── src/
│ ├── index.js # registerPlugin() + PluginSidebar + Command Palette
│ ├── components/
│ │ ├── sidebar-panel.js # Check button, results summary, clear notes
│ │ └── results-list.js # Per-block issue display with severity badges
│ └── style.scss # Sidebar and results styling
├── package.json # @wordpress/scripts build config
└── readme.txt # WordPress.org plugin readme
Run a content guidelines check on a post.
Parameters:
post_id(integer, required) — The post ID to check
Response:
{
"success": true,
"results": [
{
"block_index": 2,
"block_name": "core/paragraph",
"excerpt": "Our team of experts will help you achieve...",
"issues": [
{
"message": "Avoid 'team of experts' — use specific roles instead",
"severity": "warning",
"guideline_section": "Vocabulary / Readability",
"source": "lint"
},
{
"message": "Tone is overly promotional for an informational page",
"severity": "warning",
"guideline_section": "Brand Voice",
"source": "ai"
}
]
}
],
"notes_created": 1
}Remove all Redline-created notes from a post.
Parameters:
post_id(integer, required)
Response:
{
"success": true,
"notes_cleared": 3
}npm start # Watch mode with hot reload
npm run build # Production buildGPL-2.0-or-later