Created
June 28, 2019 22:56
-
-
Save dgowrie/b1cdfbb7badc79779f90de6745cded14 to your computer and use it in GitHub Desktop.
UPDATE string of text like URLs in WordPress posts SQL query
This file contains hidden or 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
UPDATE wp_posts | |
SET post_content = replace(post_content, 'Existing string', 'Desired replacement string') | |
WHERE post_type = 'post' | |
-- can do a 'dry run' search, if the tool doesn't offer UI (phpMyAdmin does) | |
SELECT * | |
FROM wp_posts | |
AND post_content LIKE '%Existing string%' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment