We were recently updating a site that had few hundred Concrete 5 users. As we worked on updates in our dev/test environment, we wanted to keep the user data, but we didn't want the real people accidentally getting emails.

We put together the following query to do a mass change of email addresses. It's a pretty simple SQL statement, but one that we thought others might find useful. Note: as is the norm when updating a database directly, you should make a database backup first in case something goes wrong. Also, you should only be doing this on a non-production version of your site. There's no undo approach described here for bringing back the real email addresses.

UPDATE Users SET uEmail = CONCAT('fake-email-', uID, '@concrete5tricks.com') 

This changes email addresses to something like fake-email-123@concrete5tricks.com. The use of uID ensures each email address is unique because the uID column itself is unique.

If you wanted to actually get emails from the system for these users, you could change everyone to have your email address (I don't think uniqueness ultimately matters unless you're using emails for login). If you use Gmail, you could do something like:

UPDATE Users SET uEmail = CONCAT('dan+', uID , '@concrete5tricks.com');


UPDATE Users SET uEmail = CONCAT('dan+', uName , '@concrete5tricks.com');

This would take advantage of Gmail's "+" feature to create addresses like dan+123@concrete5tricks.com or dan+dletsche@concrete5tricks.com that would still come to my dan@concrete5tricks.com inbox.

These are just a couple of many approaches. Feel free to make it your own and please share if you have other tips to avoid sending real people unintended emails.

Final Note

In this technique, you might want to avoid using dummy email addresses with random domains like @example.com, @test.com, etc. This may be treading into over-paranoia-territory, but it's easy to set up catch-all accounts. And if your C5 site sends anything sensitive, you might be putting yourself at risk. It'd be better to stick with a domain you own and/or trust.