GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Search and replace for wordpress? (https://gfy.com/showthread.php?t=1064580)

MyDogHasFleas 04-13-2012 01:44 PM

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?

AaronM 04-13-2012 01:47 PM

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.

Colmike9 04-13-2012 01:53 PM

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

GFED 04-13-2012 01:53 PM

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.

just a punk 04-13-2012 01:55 PM

Quote:

Originally Posted by MyDogHasFleas (Post 18885478)
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?

Th CyberSEO plugin can do that. It uses WP API to alter the posts instead of the direct MySQL manipulation. Thus it's much safer.

neak 04-13-2012 02:42 PM

UPDATE [your_table_name] SET [your_table_field] = REPLACE([your_table_field], '[string_to_find]' , '[string_to_be_replaced]');

papill0n 04-13-2012 02:46 PM

or you could just use this plugin

http://wordpress.org/extend/plugins/search-and-replace/

which works perfectly

adultforum 04-14-2012 02:46 AM

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