This article describes how to REPLACE the content of a post in batches by Discuz using SQL statements and using the REPLACE function to update databases in batches, you can refer to a friend's Discuz X2 forum that needs to replace the content of the post in batches. The number of posts is tens of thousands. In the beginning, words are filtered and no effect is found, you can only replace the database 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:
The Code is as follows:
UPDATE pre_forum_post SET message = REPLACE (message, "" content to be replaced "", "" New Content "");