![]() |
Search and replace for wordpress?
This is the problem that I have. I have an iframe ad in about 500 posts on a blog. I would like to replace this ad. I tried Find replace and another one. Neither of them seemed to work. Are there any plugins that can search for the iframe code in the posts and replace it with something else?
|
Whatever you use for this, be very careful.
I had a search and replace plugin that worked fine...Until it didn't and it rewrote every one off my posts. Thankfully I had a current backup or I would have been completely screwed. |
For that many posts, I would export the xml then open in notepad then find/replace all to delete or replace the iframe code then reimport (Test on a freehost or test WPMU subdomain to see if posts import correctly first before replacing posts) Find/replace plugins suck
|
Yea, make sure you backup your shit and avoid this problem next time by using an ad management system or server side/php include instead of hardcopy.
|
Quote:
|
UPDATE [your_table_name] SET [your_table_field] = REPLACE([your_table_field], '[string_to_find]' , '[string_to_be_replaced]');
|
or you could just use this plugin
http://wordpress.org/extend/plugins/search-and-replace/ which works perfectly |
If you have access to wp database you can use a code like this in your phpMyAdmin -> mySQL:
UPDATE wp_posts SET post_content = replace( post_content, 'old text', 'new text' ) ; UPDATE wp_posts SET post_content = REPLACE (post_content, ‘old text’, ‘adultforum.ro’); UPDATE `table_name` SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text') |
All times are GMT -7. The time now is 06:05 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123