Search and replace for wordpress?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyDogHasFleas
    Confirmed User
    • Apr 2008
    • 529

    #1

    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
    GFY Royality ;)
    • Oct 2001
    • 46923

    #2
    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.

    Comment

    • Colmike9
      (>^_^)b
      • Dec 2011
      • 7230

      #3
      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
      Join the BEST cam affiliate program on the internet!
      I've referred over $1.7mil in spending this past year, you should join in.
      I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

      Comment

      • GFED
        Confirmed User
        • May 2002
        • 8121

        #4
        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.
        https://www.flow.page/savethechildren

        Comment

        • just a punk
          So fuckin' bored
          • Jun 2003
          • 32393

          #5
          Originally posted by MyDogHasFleas
          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.
          Obey the Cowgod

          Comment

          • neak
            Confirmed User
            • Jan 2008
            • 168

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

            Comment

            • papill0n
              Unregistered Abuser
              • Oct 2007
              • 15547

              #7
              or you could just use this plugin

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

              which works perfectly

              Comment

              • adultforum
                SEO SPECIALIST
                • Nov 2010
                • 2438

                #8
                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')
                ICQ#: 376883609 Skype: AdultSEO

                [email protected]
                SEO Specialists - will make it happen.

                Awesome domains for sale - Reserve yours now.

                It’s never too late to MAKE MONEY with BITCOIN. Use this link and receive a 10% fee discount for 6 months.

                Comment

                Working...