WP Shortcode contact-form-7 doesn't work in theme


Contact Form 7 works in the default WP theme, however enabling my theme causes it to stop working. There are no other plugins installed, it is something in the theme stopping it from working. Other shortcodes work on this page (eg: [gallery]).

This is the shortcode: [contact-form-7 id=“153” title=“Contact form 1”]. When my theme is active this code comes straight through as-is. No errors or anything. When default theme is active this code generates the contact form.

I’ve even tried running the code directly from the template file, like <?php echo do_shortcode( '[contact-form-7 id="153" title="Contact form 1"]' ); ?> but displays nothing, even with debug on.

Any ideas on what could be stopping the contact form 7 shortcode from working when my theme is active?


check list possibly?


I had the same problem with Contact Form 7. If I well remember that was on the page, with dynamically loaded content (via ajax). I’ve added below code:

define(‘WP_ADMIN’, true);
If you’re using do_shortcode, please also try to add apply_filters function:
echo do_shortcode(apply_filters(“the_content”, “[contact-form-7 id=‘1’]”));

add the following code to functions.php in the theme folder:


  • Allow shortcodes in Contact Form 7
    function shortcodes_in_cf7( $form ) {
    $form = do_shortcode( $form );
    return $form;
    add_filter( ‘wpcf7_form_elements’, ‘shortcodes_in_cf7’ );

I was also experienced similar problem with contact form 7 but I have uninstalled the plugin and reinstall and also added another contact form 7 plugin. Now it is working properly