# Bulk delete topics/content from select users

**URL:** https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014
**Category:** Support
**Created:** [April 6, 2020, 4:19pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014 "2020-04-06T16:19:54Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 6, 2020, 4:19pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/1 "2020-04-06T16:19:54Z")

</div>

I have been pulling in content from RSS feeds but now I have stopped. I would now like to delete all that content, but from the admin/users page I can’t click a button to delete a user and all their posts/topics.

Is there a way I can override this and bulk delete users and their content? Some of my feeds have 1K+ topics…

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [April 6, 2020, 5:11pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/2 "2020-04-06T17:11:37Z")

</div>

Look at **delete all posts max** and **delete user max post age** settings in your administration. Change for a higher value, and then you’ll be able to remove all the posts from any user.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 6, 2020, 5:29pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/3 "2020-04-06T17:29:20Z")

</div>

> [@Canapin](#):
>
> delete user max post age

Getting there, thank you.

But on a user’s page, if I delete a user, will it also delete all their posts? I can’t see an option to delete posts.

 ![Screenshot 2020-04-06 at 18.28.18](https://global.discourse-cdn.com/meta/original/3X/2/3/23481a9c13457917dcd6d709141d1d8e8185f392.png)

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 6, 2020, 5:32pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/4 "2020-04-06T17:32:10Z")

</div>

Think this topic covers it:

> [@Deleting user and posts](https://meta.discourse.org/t/deleting-user-and-posts/102631/2):
>
> That’s generally the problem with deletion, you’d be removing topics and replies that user made, so with over 1,000 posts you’d expect a lot of holes in conversations. Can you anonymize the user instead? That option is available at the bottom of the user’s admin page (there’s an admin button on the top right of the user’s profile).

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [April 6, 2020, 5:36pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/5 "2020-04-06T17:36:27Z")

</div>

> [@christian\_01](#):
>
> But on a user’s page, if I delete a user, will it also delete all their posts?

When you raise the two settings I wrote about, you’ll be able to remove all the user’s messages prior removing the user itself (a user can’t be deleted if it has messages).

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 7, 2020, 1:52pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/8 "2020-04-07T13:52:00Z")

</div>

Whenever I try and delete posts (10 or 500), I keep getting this error message. Any thoughts?

 ![Screenshot 2020-04-07 at 14.51.20](https://global.discourse-cdn.com/meta/original/3X/f/e/fee143ce3041b22526b431233703863f328ad94a.png)

So, at the moment, I can’t delete posts or users.

Is there a way to override:

“There was an error deleting that user. Make sure all posts are deleted before trying to delete the user.”

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 7, 2020, 4:24pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/9 "2020-04-07T16:24:55Z")

</div>

Check `/logs` to see what the problem was, and post a redacted version of the `env` and `backtrace` here. Alternately, if you check and some but not all posts were deleted, just keep hitting the button until it finishes.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 7, 2020, 4:25pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/10 "2020-04-07T16:25:57Z")

</div>

Sorry, laymans terms please?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 7, 2020, 4:26pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/11 "2020-04-07T16:26:57Z")

</div>

Visit `forum.yourcommunity.com/logs` and see if there’s an error entry from when the post deletion failed.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 7, 2020, 4:35pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/12 "2020-04-07T16:35:44Z")

</div>

No error messages. It just stops and says "There was a problem deleting the posts’'.

I have a lot of users/posts I need to delete, so there has to be a better way?

I was hoping someone would have replied to:

> [@Bulk delete users that match an email pattern](https://meta.discourse.org/t/bulk-delete-users-that-match-an-email-pattern/147012):
>
> I would like to bulk delete users that match an email pattern such as : \*.xyz \*.fun etc… I tried this as of now : User.find(UserEmail.where("email like '%.fun'").pluck(:user\_id)).count. But I can’t use the destroy\_all function after a .where() … Could you please help ? Thanks a lot.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 7, 2020, 5:43pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/13 "2020-04-07T17:43:33Z")

</div>

I managed to get some success by flushing Redis.

> [@Discourse stuck on "Currently Upgrading"](https://meta.discourse.org/t/discourse-stuck-on-currently-upgrading/39072/17):
>
> After rebuilding via command line, the “Currently Upgrading…” is still there. And the “Reset” button does nothing

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 7, 2020, 10:40pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/14 "2020-04-07T22:40:22Z")

</div>

You should expect performance problems if you delete users with massive numbers of posts and topics, that’s a rare event – and should be avoided in favor of anonymization whenever possible.

---

<div class="post-metadata">

### Author: ![christian\_01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_01/32/162392_2.png) [@christian\_01](https://meta.discourse.org/u/christian_01)
#### Post date: [April 8, 2020, 11:00am UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/15 "2020-04-08T11:00:50Z")

</div>

> [@codinghorror](#):
>
> favor of anonymization whenev

I was having a problem deleting just 10 posts.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 8, 2020, 4:41pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/16 "2020-04-08T16:41:11Z")

</div>

That shouldn’t be happening for sure!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 8, 2020, 4:41pm UTC](https://meta.discourse.org/t/bulk-delete-topics-content-from-select-users/147014/17 "2020-05-08T16:41:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
