Bulk search and replace site content
How to find and replace text across your entire site in SGEN
The Search & Replace tool lets you swap a word, phrase, or URL across every page, blog post, settings value, and redirect on your site in a single operation. It is a power tool: one run can touch thousands of rows at once. A dry-run option shows you what would change before committing anything.
What is this for?
Search & Replace is the right tool when the same string appears in many places and you need every instance changed at once. The classic case is a domain migration — you move from www.old-brand.com to www.new-brand.com and need every internal link, canonical tag, and stored URL updated in one pass. It is also useful for a company rename or a URL-structure change that affects dozens of pages. Because the change is irreversible without a backup restore, this tool is strictly for administrators who understand what they are replacing and have verified counts on a dry run first.
Good use cases
Example 1: Domain migration — rewriting every stored URL after moving to a new domain. Your site was at www.yoursite.com and has moved to www.yoursite.com. Internal links, image src attributes, canonical URLs stored in page metadata, and site-settings values all still reference the old domain. Running a Search & Replace with www.yoursite.com → www.yoursite.com across all available tables rewrites every occurrence in one pass.
First, run the dry run to see counts before touching anything:
After the dry run, the tool reports back counts per table — for example: "Searched table posts — 47 cells found, 0 changes made (dry run)." Review every table's count. If a count looks unexpectedly high, narrow your search term or deselect that table before running live.
Example 2: Company rebrand — replacing an old company name across all published content. Your company rebranded from "Your Store Widgets Co." to "Your Store" and dozens of blog posts, page descriptions, and site settings still use the old name. A single Search & Replace with Your Store Widgets Co. → Your Store across posts and post_metas rewrites every occurrence. Dry-run first to confirm the count matches your estimate.
When the counts look right, uncheck Run as dry run and submit again. The tool reports the same table breakdown with actual change counts.
Example 3: Cleaning up a stale redirect source after restructuring URLs. Your site previously had blog posts at /news/ and now uses /blog/. The redirects table has 30 rows pointing from /news/.. source paths to /blog/... You also have internal links in older page content still referencing /news/. Running Search & Replace with /news/ → /blog/ across posts, post_metas, and redirects in one pass cleans up both surfaces.
What NOT to use this for
- Don't run without a fresh content export first. Search & Replace writes directly to the database with no undo button. If the replacement produces unintended results, recovery requires restoring from a backup. Go to Tools → Post Migration → Export and download a full export before every live run — not just dry runs.
- Don't use Case-insensitive mode unless you fully understand what it does. When case-insensitive is turned on, the replacement rewrites the entire matched cell using lowercase — not just the matched portion. A page titled "The Quick Brown Fox" that matches a case-insensitive search for "brown" will be stored as "the quick brown fox" after the run. Every character in every matched cell becomes lowercase. This is a known limitation. Leave the checkbox off unless you are certain all matching content is already lowercase.
- Don't search for very short strings. Searching for a single letter or a two-letter word like "it" can match hundredseds of thousands of cells on most sites, making every matched row lowercase if case-insensitive mode is on, or flooding the count report until it is useless. Use the most specific string possible — full domains, full phrases, full slugs.
- Don't use it for single-cell edits. If you need to fix one sentence in one blog post, open that post in the editor and edit it there. Search & Replace is a bulk tool and carries bulk risk for a single-row change.
- Don't use it as a regex engine. The tool matches literal strings only. It does not support wildcards,
*,?, character classes, or any regular-expression syntax. What you type in "Search for" is matched exactly as typed (plus an automatic second pass for URL-encoded slash variants if your search term looks like a URL). - Don't run it on a live production site without testing on a staging copy first. Confirm the replacement looks correct on staging before touching production.
How this connects to other features
- Pages and Blog Posts — both store their content, titles, slugs, and metadata in the
postsandpost_metastables. A Search & Replace across those tables touches every page and post simultaneously. - Redirects — if you are restructuring URLs and using Search & Replace to update internal links, update your Redirects rules at the same time so old external links continue to reach the right destination.
- Custom Codes — if any of your injected scripts or snippets reference the old domain or path pattern, check the
custom_codestable in the table list and include it in your run. - Tools → Post Migration (Export) — the export feature in the same Tools area produces the content backup you should always take before a live Search & Replace run. Both live under the same sidebar section.
Before you start
- You are signed in to SGEN as an admin.
- You have exported a full content backup from Tools → Post Migration → Export and confirmed the file downloaded successfully.
- You know the exact literal string to search for and the exact string to replace it with.
- You have identified which tables are likely to contain the string (check the table size badges in the form for guidance).
Where to go
- Sign in to your SGEN admin panel.
- In the left sidebar, click Tools.
- Click Search & Replace.
Steps
1. Enter the search and replace strings
In the Search for field, type the exact string you want to find. In the Replace with field, type the new string. Leave Replace with blank if you want to delete every occurrence of the search string.
2. Select the tables to search
The form lists every database table available to search. Check the tables most likely to contain your string. For domain changes, check at minimum: posts, post_metas, site_settings, redirects, and custom_codes. Unchecked tables are skipped entirely.
3. Leave "Run as dry run" checked for your first pass
The Run as dry run checkbox is on by default. Submit with it on. The tool counts matches per table and shows results — no changes are written. Review the counts carefully. If any table shows an unexpectedly large count, investigate before proceeding.
4. Review the dry-run results
After the dry run, the page reloads showing a result line for each table: how many cells matched and how many changes would be made. Verify the totals align with your expectations. If a count looks wrong, refine your search string.
5. Uncheck "Run as dry run" and submit the live run
When the dry-run counts are correct, uncheck Run as dry run and click Run Search/Replace → again. The form re-populates with your previous values so you do not need to re-enter anything. This is the live write — it changes the database immediately.
6. Verify the result on your site
After the live run, open two or three pages that should have been affected and confirm the new string appears where expected. If you use a caching layer, hard-reload the page with Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac).
What success looks like
The page reloads after the live run showing a result line for each selected table confirming how many cells were changed. For example: "Searched table posts — 47 cells found, 47 changes made." Each table you selected shows its own count. Open a few affected pages in your browser — the new string should appear where the old one was.
What to do if it does not work
- The result shows "0 changes made" on a table where you expected matches — the search string may not match exactly. Capitalization matters (unless you turned on case-insensitive mode). Try copying the exact string from the page source rather than retyping it.
- The site looks broken after a live run — restore from your pre-run export immediately via Tools → Post Migration → Import, or contact your platform administrator to restore from the automatic backup the tool created before writing.
- Page content appears all-lowercase after a case-insensitive run — this is the known behavior of case-insensitive mode: every matched cell is lowercased across its full value, not just the matched portion. Restore from backup and re-run with case-insensitive mode off.
- The replacement ran on tables you did not intend — only checked tables are written. If you see unexpected changes, verify which tables were checked. Restore from the pre-run backup if needed.
Next step
After a domain migration Search & Replace, review your Redirects list to ensure old-domain redirects are in place for any external links you cannot update. Then verify your Site Settings → General to confirm the canonical URL reflects the new domain.
Steps
Steps to run a search-and-replace
- Open Tools → Search & Replace at
your admin area. - Enter the Search for string. Match is case-sensitive by default.
- Enter the Replace with string.
- Pick the Scope — pages, posts, settings, redirects, or all.
- Click Preview. SGEN scans without writing and lists every match.
- Review the preview list. Verify the matches are what you expected.
- If correct, click Apply. SGEN performs the swap across all matching content.
- The Result screen confirms the count of changes per content type.
Steps to undo a search-and-replace
There is no automatic undo. Recovery options:
- Run a reverse search-and-replace if the original strings are still unique. Search the new value, replace with the old. Works only if the new value did not exist before the swap.
- Restore from a backup taken before the swap. Tools → Backup & Restore stores recent snapshots if backup is configured.
Tips
- Always Preview first. Apply only after Preview confirms the match list is what you expected.
- Scope tightly. "All content" is the default but rarely the right choice — restrict to pages or posts when those are the only places the change is needed.
- Avoid very short search strings. A 2- or 3-letter string can match content you did not intend.
- Take a backup before large swaps. Migration-time URL changes or domain swaps benefit from a pre-change backup.
Troubleshooting
- The preview shows zero matches but I know the string is there. Case sensitivity is on by default. Toggle it off, or match the exact case.
- The replace went through but the change is not appearing on the live site. Page/post caching may be holding the old version. Force a republish on the affected pages.
- The swap broke a page. Restore from the most recent backup. If no backup is available, hand-edit the affected pages back.
FAQs
Q: Does Search & Replace touch media file URLs? Yes if the URLs appear in page or post content. The media library itself is not modified.
Q: Can I limit the search to a date range? Not directly — Scope is by content type. Date filtering needs the source pages or posts to be filtered first.
Q: Is there a regex mode? Plain string match by default. Check the Scope dropdown for advanced options on your version.
Cross-area considerations
- Pages and posts are the most common targets. Both are scanned by default when Scope is All Content.
- Settings scope catches values stored as text — site title, footer copyright, contact info. Useful when rebranding.
- Redirects scope catches the From and To URL columns. Useful when migrating domains.
- Media library is not scanned. Filenames and alt text are stored as content of pages/posts and caught indirectly.
Operational scenarios
- Domain migration. Search the old domain, replace with the new. Scope: All Content. Always preview first; some results may be intentional historical references that should not change.
- Brand rename. Search the old brand name, replace with the new. Scope: Pages + Posts. Confirm the old brand name does not appear in legitimate historical context.
- URL slug update. Search the old URL pattern, replace with the new. Scope: Redirects + Pages.
- Phone number change. Search the old number, replace with the new. Scope: Settings + Pages + Posts.
Backup workflow
The recommended workflow for any large or risky search-and-replace:
- Take a backup snapshot under Tools → Backup & Restore.
- Run Search-and-Replace with Preview.
- Review the preview list line by line for the first 10-20 matches.
- Apply.
- Verify on the public site.
- If the result is wrong, restore from the backup.
Scope
This reference covers the Bulk Search and Replace tool — the admin-side operation that finds a text string across selected SGEN database tables and replaces every occurrence. It applies to all SGEN plans. It does not cover:
- Redirects (handling URL changes after moving pages) — use the Redirects panel for that.
- File-level find/replace (PDFs, uploaded images, media filenames) — those are outside the scan scope.
- Undoing a replace beyond the first 24 hours — always take a backup before a live run.
- Regex or pattern matching — only exact string matching is supported today.
Examples
Example 1: Rebranding across all content. Your Store rebrands their "Classic T-Shirt" line to "Signature T-Shirt". The site admin runs Search and Replace with Classic T-Shirt → Signature T-Shirt across posts and pages. Dry run shows 47 matches. After reviewing the first 10 and confirming they all look correct, uncheck dry run and apply. The live site reflects the change across all 47 instances.
Example 2: Correcting a misspelled product name. Your Store's editor notices that "Canvas Tote Bag" was entered as "Canvas Tote Bga" in 12 blog posts and product descriptions. Run Search and Replace with Canvas Tote Bga → Canvas Tote Bag. Dry run confirms exactly 12 matches. Apply and verify two posts live.
Example 3: Updating an old domain in internal links. Your Store migrates from an old domain. Run Search and Replace with oldyoursite.com → yoursite.com across all tables. Dry run finds 23 occurrences in page content and post bodies. Apply, then check five representative pages to confirm the links resolve correctly.
Fields
| Field | Purpose | Notes |
|---|---|---|
| Search for | The exact string to find | Case-sensitive; no regex |
| Replace with | The string to substitute | Leave blank to delete every occurrence of the search string |
| Tables to search | Which database tables are scanned | Select narrowly for faster runs; "all" is slower and riskier |
| Run as dry run | Shows matches without saving | Always run dry first to verify match count |
| Dry-run results | Preview list of affected rows | Shows table name, row ID, and matching excerpt |
| Apply button | Commits the replacement | Irreversible without a backup |
When NOT to use Search-and-Replace
- For URL redirects of moved pages — use the Redirects panel instead.
- For migration of large files (PDFs, images) — those are not in the scan scope.
- For database-level operations — Search-and-Replace operates on content fields only.
- For content stored outside SGEN (e.g. CMS-generated emails sent in the past) — historical sent emails are immutable.
