• Resolved stuartgre

    (@stuartgre)


    How do you stop the shortcode output from showing in the Gutenberg editor?

    All displays fine on the front-end, but upon returning to Gutenberg editor after initial save, now the content shows in the backend too…

Viewing 5 replies - 1 through 5 (of 5 total)
  • would like to know that to. did you manage to save the page with the shortcode?

    Any development on the matter?

    Thread Starter stuartgre

    (@stuartgre)

    Yes, I did a bit of research and found that you have to return values rather than printing them for the shortcodes to work properly in Gutenberg.

    Yes, @stuartgre that was my conclusion too. Thanks for the response; hope this helps others.

    This solution worked for me. Inside your theme functions wrap the add_shortcode in if is not admin:

    // Turn off shortcode display in Gutenberg
        if(!is_admin()) {
            add_shortcode('my_shortcode', 'shortcode_my_shortcode');
        }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode shows in Gutenberg’ is closed to new replies.