# Deleting posts containing X word

**URL:** https://meta.discourse.org/t/deleting-posts-containing-x-word/130523
**Category:** Support
**Created:** [October 8, 2019, 9:53pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523 "2019-10-08T21:53:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![justinGP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justingp/32/137247_2.png) [@justinGP](https://meta.discourse.org/u/justinGP)
#### Post date: [October 8, 2019, 9:53pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/1 "2019-10-08T21:53:40Z")

</div>

Hello, hope everyone is having a good day! My forum recently has a new policy where we’re cutting down on certain types of explicit language and we would like to remove them from view for both users and Google. I used the search function to look for the problematic words, but realized that if I were to use the mass selection tool, it would try to delete entire _topics_ rather than just the individual posts.

Is there a way to delete only the specific posts containing key words so that my forum’s users don’t have to see 500+ topics get incinerated? I don’t mind if I have to perform the process each time for each word, but I am not feeling keen on going in manually to delete every post one by one.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [October 8, 2019, 11:50pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/2 "2019-10-08T23:50:16Z")

</div>

Why not substitute the word, rather than delete entire replies and potentially lose context within a topic?

---

<div class="post-metadata">

### Author: ![justinGP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justingp/32/137247_2.png) [@justinGP](https://meta.discourse.org/u/justinGP)
#### Post date: [October 9, 2019, 12:23am UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/3 "2019-10-09T00:23:35Z")

</div>

If that’s possible, that solution is fantastic. However, if I were to have to do this manually, it would double or triple the amount of time needed which is already insanely high. Is there a way to do it in bulk or automate it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 9, 2019, 12:32am UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/4 "2019-10-09T00:32:31Z")

</div>

Add the words to Admin \> Logs \> Watched words \> Censor and using a rebake should do it.

> [@Rebake all posts matching a pattern](https://meta.discourse.org/t/rebake-all-posts-matching-a-pattern/48713):
>
> bookmark This guide provides instructions on how to rebake all posts in Discourse that match a specific string or regular expression, utilizing the Rails console for additional advanced options. person_raising_hand Required user level: Administrator warning Console access required Want to rebake all the posts matching a string or regular expression? Let’s get started! Accessing your site To begin, connect to your Discourse Droplet via SSH and enter the Docker container for your Disc…

---

<div class="post-metadata">

### Author: ![justinGP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justingp/32/137247_2.png) [@justinGP](https://meta.discourse.org/u/justinGP)
#### Post date: [October 10, 2019, 5:55pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/5 "2019-10-10T17:55:08Z")

</div>

This worked, thank you!

---

<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: [June 12, 2023, 10:05pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/6 "2023-06-12T22:05:34Z")

</div>



---

<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: [July 12, 2023, 10:06pm UTC](https://meta.discourse.org/t/deleting-posts-containing-x-word/130523/7 "2023-07-12T22:06:22Z")

</div>

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