Created
April 20, 2015 18:50
-
-
Save akozlik/f6b82cd2779a3fbe7c72 to your computer and use it in GitHub Desktop.
Wordpress Search and Replace
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
// NOTE: All URLs must contain their protocol and must NOT have trailing slashes | |
// Set the path for all JS / CSS / template imports | |
update wp_options set option_value = 'new_domain' where option_id in (1, 2) | |
// Update all links | |
UPDATE wp_posts SET guid = replace(guid, 'old_url','new_url'); | |
// Replace URL references in post content | |
UPDATE wp_posts SET post_content = replace(post_content, 'old_url', 'new_url'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment