I find myself using WordPress more and more for client websites. Since 90% of the time, I develop on a dev domain, it means that the links inserted by WordPress point to the dev domain which presents an issue when it’s time to hold your breath and take the new site live on the clients domain. So anyway, a useful query to update the old domain to the new domain in all of the sites’s posts is as follows:
UPDATE wp_posts SET post_content = REPLACE (post_content, 'OLD_DOMAIN', 'NEW_DOMAIN');
If you are running on a WP Multi-site installation, you’ll need to replace “wp_posts” with something like “wp_SITEID_posts” (e.g. wp_19_posts).
I hope someone will find this useful. Remember to always backup your database before you run any updates or changes just in case it goes wrong đ
January 28th, 2012 at 11:53 pm
Yes I found this very useful today đ