1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Post Content Replacement Tool

Discussion in 'XenForo Questions and Support' started by DRE, Aug 8, 2012.

  1. DRE

    DRE Well-Known Member

    Hi. I'm using Kier's Post Content Replacement Tool that uses Search / Replace.

    How do I replace the following phrase: using Tapatalk

    with a custom phrase such as: using Tapwater

    Just an example...

    postreplacement.jpg
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You don't need a regex for that. Just use this query:

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, 'using Tapatalk', 'using Tapwater');
    
     
    8thos likes this.
  3. DRE

    DRE Well-Known Member

    Thank you Based Bunce Da Gawd
     
  4. badlands

    badlands Member

    Hey Jake,

    awesome - do you also have the SQL-Query for changing single words in Thread Titles? I guess you only have to change the "xf_post" to another expression. Thanks :)!
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    Code:
    UPDATE xf_thread
    SET title= REPLACE(title, 'using Tapatalk', 'using Tapwater');
    That should do it :)
     
    Jake Bunce likes this.
  6. badlands

    badlands Member

    Thanks, Chris!
     
  7. badlands

    badlands Member

    @Jake: When I ran your query with the goal to replace "RL" with "Ralph Lauren" it also changed "URL" to "URalph Lauren". Is there a way to only change words with a Space in front and behind them to avoid this? Thanks for an Update...
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    Code:
    UPDATE xf_thread
    SET title= REPLACE(title, ' RL ', ' Ralph Lauren ');
    Put spaces before and after what you're searching for (and its replacement).
     
    OperaManiac and Jake Bunce like this.
  9. badlands

    badlands Member

    Thanks again!! So easy :)
     
  10. fionix

    fionix Member

Share This Page