# Mass-edit email of all users

**URL:** <https://meta.discourse.org/t/mass-edit-email-of-all-users/51687>\
**Category:** Support\
**Created:** [18.Октябрь.2016 11:17:22 UTC](https://meta.discourse.org/t/mass-edit-email-of-all-users/51687 "2016-10-18T11:17:22Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [21.Октябрь.2017 19:57:24 UTC](https://meta.discourse.org/t/mass-edit-email-of-all-users/51687/7 "2017-10-21T19:57:24Z")

</div>

Emails have moved to a separate table called `user_emails` (behind the scenes, users now can have multiple email addresses), so this command will have to be rewritten.

This may work:

```ruby
UserEmail.update_all("email = replace(email, 'nonce', '')")

```

…or it might set fire to the database. 🔥  
You’ve been warned 🙂

---

_[View the full topic](https://meta.discourse.org/t/mass-edit-email-of-all-users/51687)._
