🐛 ML Canvas Edit Page Bug Report
Handoff Document for Spencer Forman
The mlcanvas_edit_page tool frequently returns “HTML find string not found” even when the exact string exists in the page content.
Bug Details
Tool: mcp_fmcp-wp-shops_mlcanvas_edit_page
Behavior:
- Short, single-line find strings sometimes work (e.g.,
<div class="price-amount">$22</div>) - Multi-line HTML strings almost always fail, even when they match the content exactly
- The tool returns
"HTML find string not found"butget_contentconfirms the string exists
Reproduction Steps
- Create a page using
mlcanvas_create_pagewith HTML content - Fetch the page using
get_contentto see the raw HTML - Copy an exact multi-line string from the content
- Try to use
mlcanvas_edit_pagewith that exact string asfind_html - Tool returns “HTML find string not found”
Example That Failed
Page ID: 16813 (was deleted, recreated as 16815)
Find string attempted:
<li>One FREE 15-min reading per quarter</li>
<li>Exclusive Luminary-only sales</li>
Result: “HTML find string not found”
Verification: get_content showed this EXACT string in the raw content
Another Example That Failed
Find string attempted:
<li>15% off all practitioner services</li>
<li>15% off all shop purchases</li>
<li>Monthly spiritual newsletter</li>
<li>New & Full Moon guidance emails</li>
<li>Priority booking (48hr head start)</li>
Result: “HTML find string not found”
What DOES Work
Short single-line replacements sometimes succeed:
find_html: <div class="price-amount">$22</div>
replace_html: <div class="price-amount">$33</div>
Result: SUCCESS
Suspected Causes
- Whitespace handling – The tool may normalize whitespace differently than what’s stored
- Encoding differences –
&vs&or other HTML entities - Line break handling –
\nvs\r\nor different line ending formats - Block content vs rendered – Tool may be searching rendered HTML instead of raw block content
- Unicode normalization – Special characters like ✨ or — may encode differently
Current Workaround
Delete the entire page and recreate it with mlcanvas_create_page:
1. delete_content(page_id, force=true)
2. mlcanvas_create_page(title, html, css, status="publish", ...)
This works 100% of the time but is inefficient for small edits.
Suggested Investigation Points
- In fluent-mcp.php – Check how
find_htmlparameter is processed before searching - String comparison – Is it using exact match or some normalization?
- Content source – Is it searching
post_contentraw, the Gutenberg block JSON, or rendered HTML? - Logging – Add debug logging to see what string the tool is actually searching for vs what’s in the content
Files/Locations
- Plugin file:
fluent-mcp.php(line ~9408 area based on previous fix) - Tool name:
mlcanvas_edit_page - Related working tool:
mlcanvas_create_page(works perfectly)
Test Page
Current working Inner Circle page: ID 16815
URL: https://shopsacredground.com/inner-circle-11/
You can use this page to test the edit tool – try finding and replacing any multi-line HTML string.
The workaround (delete/recreate) works but:
- It’s slow for small edits
- It changes the page ID each time
- It requires sending the entire HTML/CSS content again
- It breaks revision history
Context
This bug was discovered while building the Sacred Ground “11” pages (Homepage 11, Shop 11, Inner Circle 11, practitioner pages, etc.)
