Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBryan Phelan
18,191 PointsWordPress Sandbox
Hi all,
I am working with a WordPress site and want to set-up a sandbox version for testing. I am using Duplicator which seems to work great for creating a sandbox site on my local host or in a subdirectory. My concern is I have lots of users who are set-up to receive various email notices, obviously I don't want members to receive these notices from a test environment. How can I safely avoid notices going to my members? Is it easiest to just drop all the users from the database?
Thanks!
1 Answer
Sue Dough
35,800 PointsIf your on localhost chances are you can't send email. If you are using a staging environment that can send email then you can overwrite the wp_mail function. Place this in your wp-config.php
// stop emails
function wp_mail() {}
Bryan Phelan
18,191 PointsBryan Phelan
18,191 PointsThanks. Why should this go in the wp-config.php file and not the functions.php file? Or does it make a difference?
Sue Dough
35,800 PointsSue Dough
35,800 PointsThis is what I found from researching. I assume because its more of a configuration for a different setup then an actual function of your application. You can try out the functions file and see if it works there as well.