Skip to content
🎉

Cyber Sale Blowout! Get 50% OFF — Limited Time Only!

Click to Save 50% (opens in a new tab)

Change the Contact Form Element “to” Adress

Important

You can now do this via the Theme Panel without any custom code!

By default the Total theme contact form element uses the site admin email address for the "to" email address and this can be modified from the main Theme Panel, however, if you wish to dynamically modify the value it is possible using a filter. This may be something you want to do if you have multiple contact forms on the site and you want them to go to different people, for example if you add a contact form to all your staff member posts you could use this filter to modify the "to" address so it goes to the staff member's email instead.

/**
 * Modify the contact form "to" address.
 *
 * @link https://totalwptheme.com/docs/snippets/contact-form-to-address/
 */
add_filter( 'vcex_contact_form_mail_to_address', function() {
   return 'your-custom-email@somewhere.com';
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets
No related snippets found
Back To Top