WordPress Contact Form 7 CF7 Shortcode not working

Facing this issue i.e. Contact Form 7 shortcode will not work, just show the raw shortcode when in Post Draft mode, trying to find any way to make it work.

Strange that it works on all other page and areas but not on this new page I am working on. I have tried to find any reason but no success so far.

Read More

Update: It was due to page being in Draft Mode , turned out that CF7 does not execute the CF7 Shortcode if page is not published and you are previewing it in Draft mode.

Related posts

2 comments

  1. Looks like only solution for now is to Publish the page and then Shortcode for Contact Form 7 works just fine.

    I discovered it today, so if you are having issue that CF7 not outputing form or giving no 404 error (that is other issue), then make sure you publish your page and see if it works.

  2. Problem was that database messed up the html code.
    Which has been right after retrieved from DB and passed to the method.

    Not sure if it is your problem, but according my searching plenty of websites nobody mentioned this between 2011-2017 !!!! OMG

    echo do_shortcode(htmlspecialchars_decode($memberModel->getContactShortcode())
    

    For me, this finally works

Comments are closed.