Skip to content

Add WP-CLI migration from beapi/anchor blocks to blockparty anchors - #12

Merged
stephane-gillot merged 2 commits into
developfrom
migration-script
Sep 22, 2026
Merged

stephane-gillot merged 2 commits into
developfrom
migration-script

Conversation

@stephane-gillot

@stephane-gillot stephane-gillot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Bulk updates to stored post content; mistakes or plugin conflicts during a live run could affect many posts, though dry-run, narrow block renames, and documented --skip-plugins mitigate that.

Overview
Adds a WP-CLI content migration path from legacy beapi/anchor / beapi/anchor-list block comments to blockparty/anchor / blockparty/anchors-list, plus MIGRATION.md covering package swap, CSS selectors, multisite --url=, revisions, and Yoast Duplicate Post workarounds.

The plugin registers wp blockparty-anchors migrate-from-anchor-block when WP-CLI is available. AnchorBlockMigrator parses block markup, renames matching blocks while keeping attributes, recurses into nested blocks, and re-serializes only when content changes. The command scans configurable post types (default: public REST types + wp_block), supports --dry-run and batching, and persists with wp_slash() so block-comment escapes are not stripped.

If wp_update_post() fails with invalid_page_template, it falls back to a direct post_content update and cache clean, logged as [update-fallback].

Reviewed by Cursor Bugbot for commit 0421419. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 232e898. Configure here.

Comment thread includes/Cli/MigrateFromAnchorBlockCommand.php Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
@stephane-gillot
stephane-gillot merged commit 64a6a94 into develop Sep 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants