Created
September 26, 2012 19:43
-
-
Save madeingnecca/3790129 to your computer and use it in GitHub Desktop.
WORDPRESS db utils
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
# Reset post metas. | |
delete from wp_postmeta where post_id in (select ID from wp_posts where post_type in('attachment','revision','post')) | |
# Reset posts. | |
delete from wp_posts where post_type in('attachment','revision','post') | |
# Migrate blog, from domainOLD.com to domain.com. | |
update wp_options set option_value = 'http://domain.com' where option_name = 'siteurl'; | |
update wp_options set option_value = 'http://domain.com' where option_name = 'home'; | |
update wp_posts set guid = replace(guid, 'http://domainOLD.com', 'http://domain.com'); | |
update wp_posts set post_content = replace(post_content, 'http://domainOLD.com', 'http://domain.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment