加载中...
如何彻底删除bbpress中已删除的topic和Post?
发表于:2010-09-21 | 分类: 网络应用
字数统计: 334 | 阅读时长: 1分钟 | 阅读量:

how to permanently delete posts?how to permanently remove deleted posts and topics in bbPress? bbpress目前没有在管理面板中提供直接删除的方法 可以自行通过phpmyadmin进行操作删除,具体是: 找到posts表,删除想要删除的文章对应的id的记录 找到topic表,删除想要删除的文章对应的id的记录 如果会SQL语言,也可用语句执行,注意将下面表的名称换成实际中用到的名字 DELETE FROM *bb_posts* WHERE *bb_posts*.*post_status* =2 ; DELETE FROM *bb_posts* WHERE *bb_posts*.*post_status* =1 ; 2 = spam 1 = deleted posts DELETE FROM *bb_topics* WHERE *bb_topics*.*topic_status* =2 ; DELETE FROM *bb_topics* WHERE *bb_topics*.*topic_status* =1 ;PLEASE CHANGE ALL * TO BACKTICKS ` 2 = spam 1 = deleted topics ———- Permanently removing deleted posts and topics in bbPress can be cumbersome. bbPress does not provide a decent way to completely remove deleted content from the database. I am not sure why… In my case, these posts mostly contain spam and there is absolutely no reason to keep them in the database any more. As it usually happens when I try to administer bbPress, I ended up executing SQL queries at the MySQL prompt. I hereby publish these SQL statements. First delete all posts in deleted topics:

DELETE FROM bb_posts WHERE post_id IN (
SELECT post_id FROM (
SELECT DISTINCT(p.post_id)
FROM bb_posts AS p LEFT JOIN bb_topics AS t ON p.topic_id=t.topic_id
WHERE t.topic_status=1
) AS bb_posts_in_deleted_topics
);

Then remove all deleted posts:

DELETE FROM bb_posts WHERE post_status=1;

Finally, remove all deleted topics:

DELETE FROM bb_topics WHERE topic_status=1;

In the bbPress administration panel, you can now use the “Tools” section to recount posts.

上一篇:
过零检测 zero crossing detecting
下一篇:
网站增加互动效果
本文目录
本文目录