When I develop a site, my final pre-deploy checklist includes a reminder to change any email addresses used during development to the new admin’s email because during development I like to make sure all site notices go to my test inbox instead of nuking my client’s inbox.
Contact Form 7 lets you send contact form emails to any address. By default, it will use the site admin address which it pulls in from WordPress’s admin email setting once, which means if you change the WordPress admin email after deployment then you still need to remember to change the CF7 mail to field.
I did not want this extra step so I setup a little filter which allows me to change the CF7 mail to field once when I setup the form and leave it alone.
Let’s Do It
First I change the CF7 mail to field to
%admin%, then I add this filter to my theme’s functions file (usually
Now you can remove an item from your delivery or pre-launch checklist because when you change the admin email the CF7 mail will change simultaneously.