# Undo an Official Warning

**URL:** https://meta.discourse.org/t/undo-an-official-warning/103655
**Category:** Self-Hosting
**Tags:** rails-console, how-to
**Created:** [December 6, 2018, 8:12pm UTC](https://meta.discourse.org/t/undo-an-official-warning/103655 "2018-12-06T20:12:56Z")
**Posts on this page:** 1
**Showing post:** 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: [December 6, 2018, 8:12pm UTC](https://meta.discourse.org/t/undo-an-official-warning/103655/1 "2018-12-06T20:12:56Z")

</div>

> 🔖 This guide explains how to remove an official warning in Discourse via the console, particularly aimed at self-hosting users.
> 
> 🙋 Required user level: System Administrator  
> 🖥 Console access required

In certain situations, a warning issued to a user may need to be retracted. This action involves removing the warning through the console, which is accessible for those with server access. If you are a hosted customer, please contact the Discourse team ([team@discourse.org](mailto:team@discourse.org)) for assistance with this process.

## Understanding user warnings

Official warnings involve two pieces of data in the Discourse database:

1. A record in the `user_warnings` table linking the warning to a user and topic.
2. The associated private message topic has its `subtype` set to `"moderator_warning"`.

To fully undo a warning, both need to be addressed: the `user_warnings` record must be deleted, and the topic’s subtype must be reset.

## Removing an official warning

To remove a warning, follow these steps:

1. **Access the server console:**

2. **Remove the latest warning:**  
If the warning you want to delete is the most recent one, execute:

3. **Find and remove a specific warning:**  
If the warning wasn’t the last one, search for the specific warning using the `user_id`:

Destroying the warning record and resetting the topic subtype will remove the warning from the user’s warning count and unmark the PM as an official warning. The private message itself will not be deleted.

> Last edited by @SaraDev 2024-11-13T00:51:26Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/undo-an-official-warning/103655)._
