Database update statement

sql, WordPress Plugins and good code samples

January 2009

UPDATE `wp_posts` SET post_title = REPLACE (post_title, “
”, “<p>”)

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://oldurl/', 'http://newurl/');
UPDATE wp_posts_nodomain SET post_content = REPLACE(post_content, 'http://oldurl/', 'http://newurl/');

test SELECT COUNT(*) post_content FROM wp_posts WHERE post_content LIKE '%http://oldurl%';