Created
January 30, 2019 05:48
-
-
Save johnalarcon/491837f9ca112576de56fe4046eaac30 to your computer and use it in GitHub Desktop.
SQL query to update URLs after moving a ClassicPress site.
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 cp_options SET option_value = replace(option_value, 'OLD_URL', 'NEW_URL') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE cp_posts SET guid = replace(guid, 'OLD_URL', 'NEW_URL'); | |
| UPDATE cp_posts SET post_content = replace(post_content, 'OLD_URL', 'NEW_URL'); | |
| UPDATE cp_postmeta SET meta_value = replace(meta_value,'OLD_URL', 'NEW_URL'); | |
| UPDATE cp_usermeta SET meta_value = replace(meta_value, 'OLD_URL', 'NEW_URL'); | |
| UPDATE cp_links SET link_url = replace(link_url, 'OLD_URL', 'NEW_URL'); | |
| UPDATE cp_comments SET comment_content = replace(comment_content , 'OLD_URL', 'NEW_URL'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment