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

XF 1.4 Removing an irrelevant BBCode en masse from database?

Discussion in 'Troubleshooting and Problems' started by MichaelCS, Oct 3, 2014.

  1. MichaelCS

    MichaelCS Member

    Good Morning XF!

    I just recently migrated from SMF to XenForo and I have a bunch, a BUNCH of clean up work to do. Part of that is stripping out things from the posts that are no longer relevent.

    Is there a way to do a database query (or whatever it is called) that will strip out [smurfy] and [/smurfy] from all my posts? Going through 50000 posts to ensure that none of them have this old BBCode would really be ummm less than ideal.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. MichaelCS

    MichaelCS Member

    I can keep the content between the tags just need the tags gone. Do you know the query I would run to do this?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    An example query would be:
    Code:
    UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
     
  5. MichaelCS

    MichaelCS Member

    Code:
    UPDATE xf_post SET message = REPLACE(message,'[smurfy]','');
    
    So like that? Replacing the new content with nothing is okay or do I need a space in there?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    That should do it.

    Take a backup first, just in case.
     

Share This Page