Misha Rudrastyh

Misha Rudrastyh

WordPress Developer

WP SQL queries generator

This tool saved me a lot of time. I hope it will be helpful for you too.

UPDATE wp_options SET option_value = REPLACE(option_value, 'http://test.rudrastyh.com', 'http://rudrastyh.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://test.rudrastyh.com', 'http://rudrastyh.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://test.rudrastyh.com','http://rudrastyh.com');
UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'http://test.rudrastyh.com', 'http://rudrastyh.com');
UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'http://test.rudrastyh.com','http://rudrastyh.com');
UPDATE wp_posts SET guid = REPLACE (guid, 'http://test.rudrastyh.com', 'http://rudrastyh.com') WHERE post_type = 'attachment';

To use this tool just specify old website URL and new website URL. Do not forget about database prefix as well (wp_ is by default). After that copy the SQL queries and run them into your database. I recommend you always make backups before it.

Here are 5 SQL queries.

© 2017 Misha Rudrastyh
Developed on with