Last active
August 29, 2015 14:16
-
-
Save MacConin/4709f14953a35818704f to your computer and use it in GitHub Desktop.
Search & Replace in modx_site_content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## searches for 'old' | |
## and replaces it with 'new' | |
## in field 'content' | |
## restricted to context 'web' (which is optionally) | |
## always make a backup | |
## there is NO undo ! | |
## optionally | |
## check if there is a match: | |
## | |
## SELECT content | |
## FROM modx_site_content | |
## WHERE content like '%old%'; | |
UPDATE modx_site_content | |
SET content = REPLACE(content, 'old', 'new') | |
WHERE content LIKE '%old%' | |
AND context_key="web"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment