You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Core AI: Excerpt generation produces meta/explanatory content instead of clean excerpt after multiple attempts #398
While testing the Core AI excerpt generation in WordPress 7.0 RC, I observed inconsistent and incorrect output after multiple generations.
Expected behavior:
Each generation should return a clean, ready-to-use excerpt
Output should be concise and directly usable
No explanations, formatting notes, or metadata should be included
Actual behavior:
After multiple attempts, the AI generates meta-style content instead of a proper excerpt
The output I got:
Here's an excerpt that captures the key points concisely:
"Managing multiple WordPress sites manually is time-consuming and risky..."
This excerpt:
Highlights the core problem
Explains the automation solution concept
Mentions features
The response includes:
Explanation of the excerpt
Bullet points describing it
Quotes around the content
Why this is an issue:
Not production-ready output
Breaks UX expectations (users expect direct content, not explanation)
SEO risk if saved without editing
Indicates possible prompt leakage or improper output sanitization
Step-by-step reproduction instructions
Opened a post in the editor
Clicked on “Generate excerpt” multiple times (3–4 times)
The system prompt for excerpt generation (includes/Abilities/Excerpt_Generation/system-instruction.php) doesn't explicitly instruct the LLM to return only the excerpt text. Without that constraint, models (especially via the HuggingFace fallback router) will sometimes include meta-commentary like "Here's an excerpt that captures the key points:" followed by the actual excerpt, bullet-point explanations, and quoted text.
The output sanitization at Excerpt_Generation.php:127 only trims surrounding whitespace and quote characters — it doesn't strip preamble or trailing commentary.
Current system prompt (trimmed):
You are an editorial assistant that generates excerpts...
Goal: ...generate a concise, engaging, and accurate excerpt...
The excerpt suggestion should follow these requirements:
- Be approximately 55 words...
- Should not contain any markdown, bullets, numbering, or formatting - plain text only
- ...
Nothing tells the model to respond with only the excerpt and nothing else.
Proposed fix
Add an explicit output-format constraint to the system instruction, before the requirements list:
Return ONLY the excerpt text itself. Do not include any preamble, introduction,
explanation, or meta-commentary such as "Here's an excerpt..." or "This excerpt
captures..." - respond with nothing but the excerpt.
And add one more requirement:
- Do not wrap the excerpt in quotation marks
This is a common pattern with LLMs — they default to being "helpful" by explaining their output unless explicitly told not to. The title generation prompt (Title_Generation/system-instruction.php) has the same gap but gets away with it more often because titles are inherently short and less prone to commentary.
This is a fairly common thing to see when using smaller models, like those you may run locally. Definitely open to reviewing a PR that updates our system instructions to try and prevent this
Activity
jamesgiroux commentedon Apr 9, 2026
Root Cause Analysis
The system prompt for excerpt generation (
includes/Abilities/Excerpt_Generation/system-instruction.php) doesn't explicitly instruct the LLM to return only the excerpt text. Without that constraint, models (especially via the HuggingFace fallback router) will sometimes include meta-commentary like "Here's an excerpt that captures the key points:" followed by the actual excerpt, bullet-point explanations, and quoted text.The output sanitization at
Excerpt_Generation.php:127only trims surrounding whitespace and quote characters — it doesn't strip preamble or trailing commentary.Current system prompt (trimmed):
Nothing tells the model to respond with only the excerpt and nothing else.
Proposed fix
Add an explicit output-format constraint to the system instruction, before the requirements list:
And add one more requirement:
This is a common pattern with LLMs — they default to being "helpful" by explaining their output unless explicitly told not to. The title generation prompt (
Title_Generation/system-instruction.php) has the same gap but gets away with it more often because titles are inherently short and less prone to commentary.Happy to open a PR with this fix if helpful.
dkotter commentedon Apr 9, 2026
This is a fairly common thing to see when using smaller models, like those you may run locally. Definitely open to reviewing a PR that updates our system instructions to try and prevent this
Takshil-Kunadia commentedon Apr 17, 2026
Hi @jeffpaul this seems like a duplicate of #395