Created
February 26, 2015 17:27
-
-
Save szbl/64c67a7fb5d8f304aa1a to your computer and use it in GitHub Desktop.
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 options (site url, home) | |
| -- | |
| UPDATE wp_options | |
| SET option_value = REPLACE( option_value, 'http://url1', 'http://url2' ) | |
| WHERE option_value LIKE 'http://%'; | |
| -- Update post content | |
| -- | |
| UPDATE wp_posts | |
| SET post_content = REPLACE( post_content, 'http://url1', 'http://url2' ); | |
| -- Update meta variables that may contain old links | |
| -- | |
| UPDATE wp_postmeta | |
| SET meta_value = REPLACE( meta_value, 'http://url1', 'http://url2' ); | |
Author
szbl
commented
Feb 26, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment