Skip to content

Instantly share code, notes, and snippets.

View flowtwo's full-sized avatar

Christian Laugesen flowtwo

View GitHub Profile
@flowtwo
flowtwo / WP - Search and Replace in SQL
Last active December 23, 2015 14:49 — forked from chrisdigital/Wordpress global find and replace in SQL
Search and replace WordPress domains in phpMyAdmin
UPDATE prefix_options SET option_value = replace(option_value, 'demo.com', 'live.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE prefix_posts SET guid = replace(guid, 'demo.com','live.com');
UPDATE prefix_posts SET post_content = replace(post_content, 'demo.com', 'live.com');
UPDATE prefix_postmeta SET meta_value = replace(meta_value, 'demo.com', 'live.com');
UPDATE prefix_term_taxonomy SET taxonomy = replace(taxonomy, 'demo', 'live');
UPDATE prefix_posts SET post_type = replace(post_type, 'demo', 'live');