# How to delete all IP addresses?

**URL:** https://meta.discourse.org/t/how-to-delete-all-ip-addresses/369260
**Category:** Support
**Created:** [June 7, 2025, 8:06pm UTC](https://meta.discourse.org/t/how-to-delete-all-ip-addresses/369260 "2025-06-07T20:06:26Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [June 7, 2025, 10:23pm UTC](https://meta.discourse.org/t/how-to-delete-all-ip-addresses/369260/2 "2025-06-07T22:23:36Z")

</div>

I went to [Ask.discourse.com](http://Ask.discourse.com) and got this, which seems probably true.

> **Deleting IP Addresses in Discourse with Rails
AI**
>
> **pfaffman:**
> 
> Where are ip addresses stored. Can I delete them all from rails?
> 
> **DiscourseHelper:**
> 
> > **Searching**
> >
> > Searching for: Where are user and post IP addresses stored in the Discourse database, and is it possible to delete all stored IP addresses using Rails or through a rake task for privacy or GDPR compliance?
> 
> > **Reading**
> >
> > Read: [Problematic IP address fields](https://meta.discourse.org/t/problematic-ip-address-fields/83785)
> 
> > **Look up database schema**
> >
> > incoming\_links,search\_logs,topic\_link\_clicks,topic\_views,user\_profile\_views,user\_auth\_tokens,user\_auth\_token\_logs,screened\_ip\_addresses
> 
> Discourse stores IP addresses in several database tables, specifically:
> 
> - incoming\_links (ip\_address)
> - search\_logs (ip\_address)
> - topic\_link\_clicks (ip\_address)
> - topic\_views (ip\_address)
> - user\_profile\_views (ip\_address)
> - user\_auth\_tokens (client\_ip)
> - user\_auth\_token\_logs (client\_ip)
> - screened\_ip\_addresses (ip\_address)
> 
> You can delete IP addresses using Rails commands if you have terminal access (self-hosted installations). For each table, you can set the relevant column (like ip\_address or client\_ip) to NULL. Example for incoming\_links:
> 
> ```ruby
> IncomingLink.update_all(ip_address: nil)
> 
> ```
> 
> You would run similar commands for each relevant table/column.
> 
> For more details and context about privacy and potential implications, see this discussion:  
> [Problematic IP address fields](https://meta.discourse.org/t/problematic-ip-address-fields/83785)
> 
> Note: If you’re on Discourse’s hosted service, you do not have SSH or Rails console access; in such cases, contact Discourse support at [team@discourse.org](mailto:team@discourse.org) for guidance.
> 
> Let me know if you need specific Rails commands for each table or further advice!

---

_[View the full topic](https://meta.discourse.org/t/how-to-delete-all-ip-addresses/369260)._
