How to Migrate Site from Development to Production

Snippets by IsItWP

Your moment has arrived! It’s time for your website to go LIVE, and this snippet will help you do it the right way, easily.

Run this code in PHPMyAdmin. Change fromaddress to your development URL, and toaddress to your production URL. All done!

SET @find = 'fromaddress';
SET @rep = 'toaddress';

UPDATE wp_options SET option_value = REPLACE(option_value, @find, @rep);
UPDATE wp_posts SET post_content = REPLACE(post_content, @find, @rep);
UPDATE wp_posts SET guid = REPLACE(guid, @find, @rep);
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, @find, @rep);	

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 11 best WordPress plugins for writers and how to use Google optimize in WordPress.

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!