Like we all know, we can use SQL to replace or remove some content in our WordPress using phpMyAdmin, on this post I will show you How To Replace/Remove Content on Your WordPress using SQL. On this trick you can access trough phpMyAdmin on your server or using plugin WP-DBManager and you can direct access trough WordPress Admin panel.
The original source is come from Digging Into WordPress blog. Did you know what DigWP? is it wonderful WordPress books by Jeff Stars and Chris Coyier. Let’s move on, after you install DB manager or logging into phpMyAdmin, go to Run SQL interface and do this code
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', '' );
On this sample, you will remove all content with nofollow on your post content. Please note you can multile SQL query to by using this method
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'nofollow ', '' ); UPDATE wp_posts SET post_content = REPLACE ( post_content, ' nofollow', '' ); UPDATE wp_posts SET post_content = REPLACE ( post_content, ' rel="nofollow"', '' );
This method do the same think but multiple query executed in one time. You can tweak this code what ever you want, like replace wordpress.org with wptricks.net, so all your content with url to wordpress.org will be replaced into wptricks.net using this method
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'wordpress.org ', 'wptricks.net' );
That’s all, I hope our tutorial replace or remove content on your WordPress using SQL worked on you, and don’t forget to get a copy of Digging into WordPress book
Photo Courtesy of Egotastic




Pingback: Find, Search, Replace, and Delete In A WordPress Database - WordCast
Hi.
Thanks for great post.Iam looking for plugin which can remove automatically posts after specific time since i have time limited offers and i dont want to keep them anymore after the end of that time!
Thanks
Hussam
Pingback: The Best way to replace words in your posts | Jhez3R
Thanks for info.. Your Information was very helpful for me.