← All playbooks · Raw API

task-bulk-find-replace

# Capability: Bulk find-replace in rich text

## Intent phrases

- find and replace across pages
- change text sitewide in body copy
- update legal boilerplate everywhere

## Requires capabilities

`bulkRtfFindReplace`

## Prerequisites

- `cms_edit ["index", "sync"]` if catalog may be stale
- `cms_edit ["list", "--type", "page"]` / `["list", "--type", "article"]` or `cms_edit ["search", "<find text>"]` to list affected entries
- Read `cms-edit://customer/routing` for slug rules

## Steps

1. **Discover scope** — `search` or `list --type page|article`; propose affected page/article count to the user
2. **Dry-run bulk replace:**
   ```
   cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…", "--dry-run"]
   ```
   Optional: `--include article`, `--prefix resources/blog`
3. **User approves** find/replace text and match count
4. **Apply:**
   ```
   cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…"]
   ```
5. Summarize how many entries were updated

For a **small** number of entries, or when per-entry `diff` is required, use session workflow: `open` → `rtf replace` → `diff` → `save`.

For scalar fields on many entries (when the field exists on this schema), prefer `batch set` with entry IDs.

## Confirmation gates

1. Propose find/replace text and affected entry count — **wait for user approval**
2. Dry-run before apply
3. Report summary when complete

## Out of scope

- Publish

## Related resources

- `cms-edit://customer/capabilities`
- `cms-edit://customer/site-facts` (if present — canonical values to apply)
- `cms-edit help bulk-rtf-replace`