Content Replace
Content Replace gives your editors and administrators a safe way to find a phrase across the whole site and replace it, with a review of every match before anything changes and an undo afterwards.
Install it when a name, a term or a phrase has to change in hundreds or thousands of places, and a blind database
search-and-replace is too risky: it would rewrite links, break markup, skip drafts and leave no way back.
What you get after installing
- A Find and replace section under Administration > Content, with a new-search form, the list
of searches, an apply queue and a replacement history. - A settings page for what may be searched: entity types and bundles, field types, and fields
never to touch. - Five permissions, so that searching, replacing, seeing other people's searches and administering
are granted separately. - Drush commands to scan, queue, apply and undo from the command line.
- A panel on your content pages that shows matches where they are read. See below.
Nothing on your site changes when you install it. Content is only changed when someone with the replace permission
applies a search they have reviewed.
The panel on the page
A list of excerpts only tells you so much. Content Replace shows the matches where your visitors would read them: on
the content's own page, in its real layout.
- Highlighted in place. Every match of the search in that item is marked in the text, includimatches inside Paragraphs, and only in the field it was found in.
- Step through them. The panel says which match of how many you are on, has Previous and Next, and
shows the text proposed for each. - Nothing hidden. Matches the page does not display, such as a link's URL text, an image's
alternative text or a field the display hides, are counted in the panel with their field and a link to edit them. - Choose and replace on the spot. Exclude single matches, then replace the rest of that item the panel. It asks first, says what would change, and the result can be undone from the same page.
- Straight to the field. Edit opens the edit form at the field of the match, unfolding whatever it
is nested in. - Any page tells you. Visit a piece of content the ordinary way and a small box names the open
searches that list matches in it, with a button to show them. - Only for those who may see it. Visitors, and anyone who may not view the search, get the page
exactly as it always was, with no script and no extra markup.
The panel can be minimized or hidden, and Escape hides the highlights. It works on content (nodes); other entity types
open their page without it. The box that names searches can be turned off in the settings.
Features
Safe by design
- Review before anything changes. Each match is shown as the text is and as it would become. Single matches can be excluded.
- Markup is left alone. In formatted text, tags, attributes, comments and scripts are never changed, and neither are the URLs, e-mail addresses and file names inside the text.
- Undo. A replacement records what each field held before. Undoing puts that text back where it has not been edited since.
- Access is respected. A scan looks only in what the owner of the search may view. Replacing alsoneeds edit access to each item and field.
- Invalid text is refused. A replacement that would empty a required title or overrun a field's length is skipped, and says why.
- Edits are not overwritten. Content edited after it was scanned is scanned again before it is replaced.
Fits how your site is built
- Paragraphs is supported. Paragraphs, nested at any depth, are searched, replaced and undone withe item they belong to, and their matches are listed under it.
- Revisions, translations and content moderation. The latest revision is what is scanned and replaced, each translation on its own, saved as a new revision.
- More than body text. Titles, plain and formatted text, link text, image alternative text and titles, and file descriptions.
- Any content entity type with fields and numeric IDs can be ticked in the settings: content,content blocks, media, taxonomy terms and those of other modules.
- Limit and group searches by what content refers to, such as a section or department vocabularyand export one file per group.
Built for large sites
- Resumable. Scanning and replacing run in steps that can be stopped and resumed, from the pagefrom Drush or on cron.
- An apply queue. Several reviewed searches can be queued and applied in one confirmed step.
- CSV export of the matches, for review outside the site.
- No cost while idle. With no search open, the module does nothing when content is saved.
Searching
- Find only. People without the replace permission can still search, review and export.
- Regular expressions, whole words, case sensitivity, and "preceded by" and "followed by" text.
Post-Installation
- Grant permissions at Administration > People > Permissions.
- Search content site-wide: find, review and export. Cannot change content.
- Replace content site-wide: apply replacements and undo those of any user. Restricted.
- View any search, Bypass content access when searching and Administer find and replace: restricted, for administrators.
- Check what may be searched at Administration > Configuration > Content authoring > Fiand replace. Installing ticks content, content blocks and media, where your site has them, and every field type themodule knows. No field is excluded. An entity type you install later is not searched until you tick it.
- Run a first search at Administration > Content > Find and replace. Start with a find-onlsearch to see what it lists.
- Make sure cron runs. Cron continues paused scans, scans changed content again and removes replacement data too old to undo (90 days by default).
If your site has none of content, content blocks or media when you install, nothing is ticked: the search page and the
status report tell you to choose in the settings.
Additional Requirements
Drupal 11.3 or later, with the Views and User modules of core. Nothing else is required.
Recommended modules/libraries
- Paragraphs: supported. Its content is searched and replaced with the item it is nested in.
- Content Moderation and Content Translation (core): drafts and translations are followed.
- Drush 13 or later: commands to scan, queue, apply andundo.
Good to know before you install
- The panel on the page works for content (nodes) only.
- Layout Builder inline blocks are not searched; reusable content blocks are.
- Entity types with text IDs are not searched.
- Uninstalling removes everything the module stored: searches, matches and the replacement history. Content it changed stays as it is.
Similar projects
Search and Replace Scanner is the long-established module for this job, and it also offers regular expressions, Paragraphs support and undo. Choose Content Replace if you need replacing to respect each user's edit access, to cover link text, image alternative text and file descriptions, to run in resumable steps on a large site, or to review and exclude single matches, including on the content's own page, before anything is saved.
Use of AI
This module was developed with the assistance of AI coding tools, which wrote and revised code, tests and documentation under the direction of the maintainer. The maintainer reviewed the changes and is responsible for the module. The automated tests, coding standards and static analysis that run on every change apply to all of it, however it was written.
Supporting this Module
Report bugs and suggest features in the issue queue. Reviews and patches are welcome.
Community Documentation
The README covers installation and configuration. The guide in docs/guide.md describes every page and rule in detail.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-alpha1 | Pre-release | 11 | Oct 7, 2026 |