How to allow shortcodes to work in Contact Form 7 in WordPress

Contact Form 7 is a great plugin to make custom contact forms on your WordPress site. If you are using shortcodes in your WordPress site, you may want to make it so they will work in the Contact Form 7 plugin’s contact forms. Just add this WordPress Code Snippet to the functions.php file in your current WordPress theme in order to make it so your shortcodes will work when placed in Contact Form 7 plugin’s contact form.

 * Allow shortcodes in Contact Form 7 
 * @author
 * @link
function shortcodes_in_cf7( $form ) {
	$form = do_shortcode( $form );
	return $form;
add_filter( 'wpcf7_form_elements', 'shortcodes_in_cf7' );

That’s it, now your shortcodes can be called inside Contact Form 7 forms and will work correctly. Hope this helps, enjoy!

   Related Sponsored Links

Disclaimer: The information contained in this website is for general information purposes only and in no event will this site or its owners be liable for any losses or damages associated with your use of our site or content. Click here to see our full Disclaimer.

Leave a Comment