Today, a friend's Discuz X2 Forum needs to replace the content of posts in batches. There are tens of thousands of posts. In the beginning, words are filtered and the results are ineffective. They can only be replaced by databases in batches, for more information, see.
The Discuz X2 Forum provides the database SQL statement operation function in the background. However, this function is disabled by default for security reasons. You must modify the configuration file as follows:
Find the Forum program file config/config_global.php, open the file in notepad, and find $ _ config ['security'] ['querysafe '] ['status'] to set it to 0, continue to search for $ _ config ['admincp'] ['runquery'] and set it to 1. (For security reasons, we recommend that you change the values of these two parameters after the SQL statement is executed)
The following describes how to modify the content of Discuz X2 in batches:
1. Go to the Discuz X2 backend → webmaster → database → upgrade
2. Enter the following statement and submit it:
Copy codeThe Code is as follows:
UPDATE pre_forum_post SET message = REPLACE (message, "" content to be replaced "", "" New Content "");