Skip to:
Content
Pages
Categories
Search
Top
Bottom

Trashing/Deleting Topics


  • craigcotner
    Participant

    @craigcotner

    With a fairly large board, I m finding that deleting old topics to be painfully slow. When topics have 500 replies, it is not TOO bad. Sending to the trash takes about 3 minutes and emptying the trash take about another 5 minutes. Not great, but not too bad.

    But when topics have 1000-2000 replies, it often times out. So it moves some of it to the trash. I select it again and the big topics eventually get to the trash. Then comes the empty trash part. It just takes forever. Usually times out. I have to empty the trash several times to get those large topics finally gone. The process for those large threads takes 30 minutes or so.

    Am I doing something wrong here? Should I be using some other type of process to get rid of old topics?

    How are the rest of you handling this?

Viewing 19 replies - 1 through 19 (of 19 total)

  • Robin W
    Moderator

    @robin-w

    in all honesty, I’m no sure many people have topics with 2000 replies and indeed ones that they then want to trash πŸ™‚

    As it happens, I’m looking at how topics get trashed at the moment – add a new reply to this topic if I haven’t come back in a week


    craigcotner
    Participant

    @craigcotner

    Well… this board and the board that supports WordPress are straight up Q&A boards. People asking questions like I am.

    But my board is a discussion board/forum. So you have topics that get hundreds, even thousands of replies. So I was just wondering how that is handled. Nice to know that this is something you just happen to be looking at! So you go do your thing!


    Robin W
    Moderator

    @robin-w

    Not suggesting what you are doing is wrong, just that I suspect it is unusual πŸ™‚


    β€Ž
    Participant

    @iqfy

    I am experiencing the same issue, but my topics only have about 90-300 replies each. Bulk deletion is a complete no go: after timing out and waiting 5+ mins, at best I’ll see one deleted thread from the 20 selected.


    craigcotner
    Participant

    @craigcotner

    I have had to break huge topics down to 300-500 replies. Then trash and empty the trash each of those smaller topics one by one. There is no such thing as bulk deletion for me. πŸ™‚


    Jimmyt53
    Participant

    @jimmyt53

    I’d also be very interested in this. My forum has been running for 12 years and many of the issues it has covered have been ovetaken by changes in the law. Basically I want to take out five years of topics and replies but I don’t want to have to go through month by month. Any assistance with mass pruning would be terrific as I’m reaching file capacity with my server.


    Robin W
    Moderator

    @robin-w

    All – let me just clarify that I’m just a guy sat in his kitchen who helps out here, I am not a bbpress author !!


    @craigcotner
    & @iqfy- trashing topics or replies calls a standard WordPress function which checks for comments and media on each post before trashing. This involves a database lookup to check whether anything in those tables needs deleting and it is this that seems to be taking the time and making you both time out. Topics and replies don’t have comments or media that is attached in that way, so these steps are not needed.

    Now trashing a reply is fairly easy, replies don’t hold any data that needs referencing elsewhere that we need to worry about.

    But Topics have engagements and subscriptions to be gone through.

    so if I wrote some code to allow you to delete a numbered topic, this could use a quicker method to permanently delete all the replies, and then use the proper function to delete the topic.

    And as long as the topic or reply it is not latest activity, then we can maybe skip the step that needs to recalculate what the lastest activity now needs to be.

    That should prevent timeouts I hope.

    SO 2 things here

    1. any topic/reply being got rid of should not be the ‘latest activity’ in the forum – but I’m guessing if the topic is still getting replies and therefore ‘hot’ then you would not be deleting it
    2. this would be deleting it a numbered topic at a time, so you would look up the topic and then in the dashboard there would be an option to enter that topic number to trash it.

    Does that sound as if it would work for you?


    @jimmyt53
    – not sure how easily I’d be able to fix that, but I’ll think about it as I progress. so

    1. how would you want to pick topics for deletion – by ‘older than’ presumably? and
    2. just from one forum or across all forums?
    3. again could not be a topic or reply where it is latest activity

    Feedback before I start code something that doesn’t help would be great πŸ™‚

    and from all – are we talking about permanently deleting – ie reduce database size, or just trashing – ie stopping people seeing, but retaining the ability to restore later?


    craigcotner
    Participant

    @craigcotner

    I totally get that you are not an author… Your bbp Style Pack is the first plugin I added to my install.

    My site is a gathering of sports fans. So we have a lot of threads that get very big. I do a few things since I just moved over from a phpBB board. I first took some topics that were several years old and had thousands of replies and first split them up. Only keeping the newer posts. Then took the older thread and put it in a holding area. Then I break them down in to smaller pieces so I can delete them. This is the part that is taking forever to do.

    This is sort of a first time clean up of the old phpBB board after I imported it to bbPress. So once I get through that, I can see a time where I am not deleting old threads as much.

    But for the long haul, I can see where I would regularly close threads and want to delete them. So I like how I can just put topics in a “holding” forum that only I can see. Then if you have a way through your plugin that I can enter a topic ID for deletion would work perfect!


    Robin W
    Moderator

    @robin-w

    thanks for that – it all helps me decide what route to go.

    So wordpress has several states, these include draft, publish and trash. You can then permanently delete – this gets rid of them from the database, which makes it faster for lookups. Given the power of servers nowadays, many sites will have no problem with a significant database, so permanently deleting may not speed up your site, but is cleaner if you are sure you never want them back.

    However your post does give a further alternate that I was not imtending, but might be your solution. If you create a ‘hidden’ forum, then this is only visible to moderators and keymasters. So instead of using a plugin that I write, you could simply move topics into that hidden forum

    so

    dashboard>forums>add forum> call it what you like but in forum attributes (top right) and set visibility to hidden

    then for each topic

    dashboard>topics>all topics>edit topic>topic attributes (top right) and just change the forum it belongs to to the new hidden one.


    Jimmyt53
    Participant

    @jimmyt53

    Hi Robin and thanks for picking up on this. To answer your questions:

    1. how would you want to pick topics for deletion – by β€˜older than’ presumably?

    Yes. A the moment I have to go month by month and wait for WP to do its thing

    2. just from one forum or across all forums?

    All forums.

    3. again could not be a topic or reply where it is latest activity

    Not an issue as these topics and replies would be at least seven years old

    4. Are we talking about permanently deleting – ie reduce database size, or just trashing – ie stopping people seeing, but retaining the ability to restore later?

    Permanent deletion required as my ISP is telling me that I’m nearing my limit on the number of files (but not the capacity in terms of memory usage) and this would allow me to get rid of material that is no longer relevant.


    Robin W
    Moderator

    @robin-w

    @jimmyt53 – thanks

    I’ll try and work up some code in the next couple of days


    craigcotner
    Participant

    @craigcotner

    Hey @robin-w … have you had any luck implementing something in to your plugin?


    Robin W
    Moderator

    @robin-w

    Apologies, I’ve been tied up in a paid project, and this had slipped from my memory.

    The actual code that does the work is a few lines, but it needs wrapping in lots of checks and stuff that limits, but I’m back looking at it now πŸ™‚


    Robin W
    Moderator

    @robin-w

    making progress, but it is a lot of work to do the testing phase.

    Queen’s jubilee here in the uk, so may be early next weeek before I have a tested version


    craigcotner
    Participant

    @craigcotner

    @robin-w absolutely zero rush at all. Have some fun!!!

    I am excited to see what you come up with. Right now I have 2 topics, both with 449 replies, that I would love to test out once you have something ready. Delete one the old fashion way and see how long it takes and then your new way. Right now I am guessing the current way would take 6-7min to send to the trash and another 9-11min to completely delete.


    Robin W
    Moderator

    @robin-w

    ok, I’ve kicked this around enough now to think it is working, and spent way longer on it than intended πŸ™‚

    so go to

    bbp topic deleter

    and download and install/activate the plugin.

    You’ll see a new dashboard item of ‘Topic Deleter’ – enter and see if it does what you want.

    You do need to know the ID’s of your forums, this is easily found by going into dashboard>forums>all forums>edit forum and you’ll see in the browser bar

    mysite.comn/wp-admin/post.php?post=29602&action=edit

    so 29602 is the forum ID in the above example.

    Feedback welcome, but read the warnings – you need to understand them πŸ™‚


    craigcotner
    Participant

    @craigcotner

    @robin-w

    WHOA!!!!

    I had two topics, both with 449 replies. I removed on the old fashioned way. It took 4:58 to send to the trash and 9:03 to empty the trash. So basically 13 minutes to get rid of it.

    On topic 2, I used your plugin. I used the “Permanently Delete any – delete topics with a status of publish or trashed – deletes topics and their replies in the database” option. It took 6-7 seconds to be permanently gone! I then removed a topic with 2200 replies and it removed in the same amount of time.

    OUTSTANDING WORK!!!!


    Robin W
    Moderator

    @robin-w

    Hey that’s really great to hear, makes it worth the work to create πŸ™‚


    craigcotner
    Participant

    @craigcotner

    @robin-w It would have taken hours and hours and hours to get ride off all I needed to get rid of. So THANK YOU!

Viewing 19 replies - 1 through 19 (of 19 total)
  • You must be logged in to reply to this topic.
Skip to toolbar