Surendra.S Posted October 30, 2018 Posted October 30, 2018 Hi All, Any idea how can I delete all posts with exact match to a particular content ? I used IPB 'Search' feature to view there are 2000 posts with exact match to the particular phrase. But I can't find the moderation option to SELECT ALL those posts & DELETE.
Ramsesx Posted October 30, 2018 Posted October 30, 2018 4 hours ago, Surendra.S said: But I can't find the moderation option to SELECT ALL those posts & DELETE. Because there is no (sadly).
Surendra.S Posted October 30, 2018 Author Posted October 30, 2018 10 minutes ago, Ramsesx said: Because there is no (sadly). Thank You for the reply sir. Any there any other way you can think of ? I am open to executing a DELETE query also on database.
Ramsesx Posted October 30, 2018 Posted October 30, 2018 8 minutes ago, Surendra.S said: Any there any other way you can think of ? I am open to executing a DELETE query also on database. Sorry, I don't know a way how to delete them. You could create a support ticket and ask for a db query, if there is any, to run it by sql. https://invisioncommunity.com/clientarea/support/
Surendra.S Posted October 30, 2018 Author Posted October 30, 2018 Thank You. I doubt if they will help with custom query like this. But let me try. if any others are aware of what to do for this type of requirement, please reply.
Faqole Posted October 30, 2018 Posted October 30, 2018 3 hours ago, Surendra.S said: Thank You. I doubt if they will help with custom query like this. But let me try. if any others are aware of what to do for this type of requirement, please reply. You can try the following, but first of all make a backup of your database. To select all posts that contain a certain keyword, run this query at the sql box of phpmyadmin, or whatever tool your host is using to manage the databases. SELECT * FROM forums_posts WHERE post LIKE '%keyword%'; 2 things to note here. If you are using a prefix for your database, append it to the table name in the query above and replace keyword with the word that you want to use as a match for all posts containing it. Then select the rows that will be displayed and delete them. Or you can use this query to simply remove only that word from all posts by replacing it with a blank space, without the post(s) itself being deleted. UPDATE forums_posts SET post = REPLACE(post, 'keyword', '') WHERE post LIKE '%keyword%'; Hope it helps.
Surendra.S Posted October 30, 2018 Author Posted October 30, 2018 1 hour ago, Faqole said: You can try the following, but first of all make a backup of your database. To select all posts that contain a certain keyword, run this query at the sql box of phpmyadmin, or whatever tool your host is using to manage the databases. SELECT * FROM forums_posts WHERE post LIKE '%keyword%'; 2 things to note here. If you are using a prefix for your database, append it to the table name in the query above and replace keyword with the word that you want to use as a match for all posts containing it. Then select the rows that will be displayed and delete them. Or you can use this query to simply remove only that word from all posts by replacing it with a blank space, without the post(s) itself being deleted. UPDATE forums_posts SET post = REPLACE(post, 'keyword', '') WHERE post LIKE '%keyword%'; Hope it helps. Thank You Sir ! I have decent knowledge on queries. So I understand what you mentioned above. In fact, its a nice idea to UPDATE the posts instead of DELETING. But my requirement is to DELETE all the posts that have the particular keyword. I can write the query for that also. But I have no idea what consequences might be there if I DELETE the posts. (For eg, the Deleted posts may have references in other tables, and it may affect the post counts etc)... Cannot understand why IPB did not provide any MODERATION options in Search Results page.
Faqole Posted October 30, 2018 Posted October 30, 2018 33 minutes ago, Surendra.S said: Thank You Sir ! I have decent knowledge on queries. So I understand what you mentioned above. In fact, its a nice idea to UPDATE the posts instead of DELETING. But my requirement is to DELETE all the posts that have the particular keyword. I can write the query for that also. But I have no idea what consequences might be there if I DELETE the posts. (For eg, the Deleted posts may have references in other tables, and it may affect the post counts etc)... Cannot understand why IPB did not provide any MODERATION options in Search Results page. Personally I would advice against deleting stuff from the database as it might cause complications. However, post counts will be affected anyways, no matter how a post is deleted. That being said, a better way to do that is to write a script/app to delete the posts properly.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.