# Discourse Spoiler-Alert

**URL:** https://meta.discourse.org/t/discourse-spoiler-alert/12650
**Category:** Plugin
**Tags:** official, spoiler-alert, included-in-core
**Created:** [February 12, 2014, 3:47am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650 "2014-02-12T03:47:17Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [February 12, 2014, 3:47am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/1 "2014-02-12T03:47:17Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Discourse Spoiler Alert** provides the ability to hide content marked with a `[spoiler]` tag in posts. |
| 📖 | **Install Guide** | **This plugin is bundled with Discourse core**. There is no need to install the plugin separately. |

> [@](#):
>
> :discourse2: As this is an #official plugin maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate plugin tag. Click on a link below to get one started. 👍
> 
> [❓&nbsp; **Support**](https://meta.discourse.org/new-topic?category_id=6&body=%3E%20Before%20asking,%20did%20you%20search%20first%3F%20Press%20%F0%9F%94%8D%20at%20the%20upper%20right%20to%20search.&tags=spoiler-alert "Ask for support on configuring and using Discourse Spoiler Alert") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=spoiler-alert "A bug report means something is broken, preventing normal/typical use of the plugin") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=spoiler-alert "Discussion about the user interface of Discourse Spoiler Alert, and how features are presented (including language and UI elements)") [💡&nbsp; **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=spoiler-alert "Discussion about how existing Discourse Spoiler Alert features can be improved or enhanced, and how proposed new features could work")

### Enabling Spoiler Alert

This plugin is default enabled once installed but can be disabled/enabled from its settings, accessed from your `admin/plugins` page:

![enable spoiler](https://global.discourse-cdn.com/meta/original/4X/0/3/e/03e1586df8222c641e0ff68861b26f0640d2d18d.png)

### Features

Once enabled it adds a ‘Blur Spoiler’ option to the ⚙ menu in the composer’s formatting bar. Simply highlight the text you’d like to blur and select ‘blur spoiler’ and it will wrap the selected text in the necessary `[spoiler]` tags:

 ![blur spoiler option](https://global.discourse-cdn.com/meta/original/4X/d/7/7/d77fb5d2c0914f33c8a6cb06894b79b1bacb8c50.png)

#### Examples:

Inline:

```plaintext
[spoiler]This is a spoiler[/spoiler] 

```

This is a spoiler

Multiline:

```plaintext
[spoiler]

I wanna be your vacuum cleaner
Breathing in your dust
I wanna be your Ford Cortina
I will never rust
If you like your coffee hot
Let me be your coffee pot
You call the shots
I wanna be yours

https://johncooperclarke.com/poems/i-wanna-be-yours

[/spoiler]

```

I wanna be your vacuum cleaner  
Breathing in your dust  
I wanna be your Ford Cortina  
I will never rust  
If you like your coffee hot  
Let me be your coffee pot  
You call the shots  
I wanna be yours

[https://johncooperclarke.com/poems/i-wanna-be-yours](https://johncooperclarke.com/poems/i-wanna-be-yours)

Clicking on the blur will reveal the hidden text, and clicking again will re-blur it.

It also works for images:  
(to re-blur an image that is large enough to generate a lightbox, you can click on the adjacent white space or refresh the page)

 ![spoiler image example](https://global.discourse-cdn.com/meta/original/4X/2/4/c/24c095f19a73ab91d6ec899615335a286475c99a.jpeg) 

### Settings

| Name | Description |
| --- | --- |
| spoiler enabled | Enable the spoiler plugin. If you change this, you must rebake all posts with: “rake posts:rebake”\[1\] |

> :discourse2: Hosted by us? This plugin is available on all of our hosting tiers [Spoiler Alert | Discourse - Civilized Discussion](https://www.discourse.org/plugins/spoiler.html)

* * *

1. :discourse2: If you’re a hosted customer of ours, please contact [team@discourse.org](mailto:team@discourse.org) if you have any questions about needing to ‘rebake’ due to a setting change 

> Last edited by @tobiaseigen 2025-07-16T20:45:02Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 24, 2023, 12:58pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/109 "2023-10-24T12:58:57Z")

</div>

Moved to core:

[https://github.com/discourse/discourse/commit/89580ee379945c36283379d105517ba2f00ac6a7](https://github.com/discourse/discourse/commit/89580ee379945c36283379d105517ba2f00ac6a7)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 24, 2023, 4:00pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/110 "2023-10-24T16:00:27Z")

</div>

ℹ **Discourse Spoiler Alert** has now been bundled with Discourse core, so this plugin will no longer need to be installed separately. 🥳

If you self-host you should see some information on your dashboard about removing it from your `app.yml`.

> :discourse2: Hosted by us? This change will not affect you in any way. 👍 You can continue to enjoy this plugin and not worry about a thing.

---

<div class="post-metadata">

### Author: ![ismailarilik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ismailarilik/32/116631_2.png) [@ismailarilik](https://meta.discourse.org/u/ismailarilik)
#### Post date: [December 15, 2023, 9:10pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/111 "2023-12-15T21:10:10Z")

</div>

I don’t understand why this plugin is enabled by default. Isn’t it only useful for movie forums?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [December 15, 2023, 9:23pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/112 "2023-12-15T21:23:14Z")

</div>

There are plenty of reason to hide text than movie spoilers. More than punchlines of jokes.

---

<div class="post-metadata">

### Author: ![Monikas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monikas/32/375316_2.png) [@Monikas](https://meta.discourse.org/u/Monikas)
#### Post date: [July 14, 2024, 5:01am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/113 "2024-07-14T05:01:52Z")

</div>

Is it possible to add a feature to show the spoiler content after clicking ‘like’ on the post?

---

<div class="post-metadata">

### Author: ![ondrej](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ondrej/32/198804_2.png) [@ondrej](https://meta.discourse.org/u/ondrej)
#### Post date: [July 14, 2024, 6:16am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/114 "2024-07-14T06:16:29Z")

</div>

You’re more than welcome to create a #Contribute > Feature #spoiler-alert topic 😉

---

<div class="post-metadata">

### Author: ![Monikas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monikas/32/375316_2.png) [@Monikas](https://meta.discourse.org/u/Monikas)
#### Post date: [July 14, 2024, 9:30am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/115 "2024-07-14T09:30:32Z")

</div>

😉, I’m on my way.

---

<div class="post-metadata">

### Author: ![Mako-Poisoned](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mako-poisoned/32/491709_2.png) [@Mako-Poisoned](https://meta.discourse.org/u/Mako-Poisoned)
#### Post date: [March 7, 2025, 3:34am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/116 "2025-03-07T03:34:03Z")

</div>

Is there anyway to edit the contents of how the spoiler preview looks? The current implementation looks nice, but it doesn’t abstract enough as far as what it’s spoiling.

Here’s an example from a thread I made, where users can upload their screenshots. If the screenshot is a spoiler, it needs to be tagged as such. As you can tell, the current implementation doesn’t really work in the context of spoiler tagging screenshots of critical moments in games, movies, etc.

Anyone who is familiar with the game I shared would immediately know what it is.

Image from my discourse board below.

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/9/0/59067d5d8014536ca00dc54f59aa705df810dbc3.jpeg)

Is there a way to adjust this?

**Edit:** It’s also come to my attention that if any user clicks the edit history of a post that contains spoilers, the edit history _will not_ spoiler tag the contents.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [March 7, 2025, 4:41am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/117 "2025-03-07T04:41:36Z")

</div>

What are you planning to make it like? More blurry? A different color of the blur?

---

<div class="post-metadata">

### Author: ![Mako-Poisoned](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mako-poisoned/32/491709_2.png) [@Mako-Poisoned](https://meta.discourse.org/u/Mako-Poisoned)
#### Post date: [March 7, 2025, 4:42am UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/118 "2025-03-07T04:42:25Z")

</div>

If I could, I’d either turn it completely black, or make it blurrier.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [March 8, 2025, 4:58pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/119 "2025-03-08T16:58:25Z")

</div>

Here is the default css for the blur part

```css
.spoiler-blurred img {
  filter: blur(1em);
}

```

Change the 1em to something more important

```css
.spoiler-blurred img {
  filter: blur(5em);
}

```

And if you want to blur more when the cursor is on the image, add these line and change the 0.5em (with a value less important than the one before)

```css
.spoiler-blurred {
  .discourse-no-touch & {
    &:hover, &:focus {
      img {
        filter: blur(0.5em);
      }
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![Luna\_Mora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/luna_mora/32/527917_2.png) [@Luna\_Mora](https://meta.discourse.org/u/Luna_Mora)
#### Post date: [September 1, 2026, 6:08pm UTC](https://meta.discourse.org/t/discourse-spoiler-alert/12650/120 "2026-09-01T18:08:23Z")

</div>

Not sure if this is worth a separate bug report or not, but realized via a chat push notification that the spoiler text isn’t being redacted like it does for everything else – `Chat::Message#push_notification_excerpt` truncates the raw markdown and will literally output the spoiler as `this is a chat notification [spoiler]and this is the spoiler[/spoiler]`, which kind of defeats the purpose of a spoiler tag, if it outputs the whole spoiler in the notification! 😂 Seems like an oversight as it bypasses spoiler-alert’s `:reduce_excerpt` completely for a chat message vs a forum post. It otherwise functions just fine in chat! it’s the push notification that’s the problem.
