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

XF 1.5 Mass edit posts

Discussion in 'Installation, Upgrade, and Import Support' started by JackieChun, Apr 10, 2016.

  1. JackieChun

    JackieChun Active Member

    I need to delete the following text from ALL posts on the forum. Can anyone help me with a phpMyAdmin query?

    Code:
    [URL='https://example.com']Link[/URL]
     
  2. AndyB

    AndyB Well-Known Member

    Make sure you backup your database first.

    Code:
    UPDATE xf_post SET message = REPLACE(message, "[URL='https://example.com']Link[/URL]", '')
    
     
    JackieChun likes this.
  3. JackieChun

    JackieChun Active Member

    Thanks AndyB! If an extra set of eyes wants to look at the query before I run it, please feel free. :)
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It's good.
     
  5. JackieChun

    JackieChun Active Member

    I ran the query twice, and nothing happened. The text in question is still in the posts. Steps taken:

    1) Choose the XenForo database in phpMyAdmin
    2) Select the Query tab
    3) Paste the command and press Submit Query

    There was no confirmation or a message after I pressed submit.
     
  6. AndyB

    AndyB Well-Known Member

    1) Choose the XenForo database in phpMyAdmin
    2) Select the xf_post table
    3) Select the SQL tab
    4) Paste the command and edit as needed, press Go
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    You may be seeing a cached version of the post. If you edit a post in question, is the text you wanted to remove still there?
     
  8. JackieChun

    JackieChun Active Member

    @Jeremy yes, the text is still there even when trying to edit, so it's not cached.

    @AndyB When I select the xf_post table prior to selecting the SQL tab, the query box is automatically populated with the following on line 1:

    Code:
    SELECT * FROM `xf_post` WHERE 1
     
  9. AndyB

    AndyB Well-Known Member

    This is normal, just delete that line.
     
  10. JackieChun

    JackieChun Active Member

     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    That would suggest the query does not match the content.

    Double check the content you are targeting by using the bb code editor.
     
  12. JackieChun

    JackieChun Active Member

    @Brogan I did use the bb code editor. The original query resulted in 1 rows affected, but that did not delete the actual text from the posts. Then I used instructions in @AndyB 's follow-up post, and that results in 0 posts affected.
     

Share This Page