Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Dev to production domains in Wordpress
update `wp_options` set `option_value` = replace(`option_value`,'website.dev','beta.example.com');
update `wp_posts` set `guid` = replace(`guid`,'website.dev','beta.example.com');
update `wp_posts` set `post_content` = replace(`post_content`,'website.dev','beta.example.com');
update `wp_postmeta` set `meta_value` = replace(`meta_value`,'website.dev','beta.example.com');
/*
Going from a development domain to a beta or production url - updating your wordpress database in a few queries. There may or may not be other tables/settings that should be update. I've found the above to work for me.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment