Title: html block and shortcode block
Last modified: December 13, 2021

---

# html block and shortcode block

 *  [Cindy Barnard](https://wordpress.org/support/users/cindy-barnard/)
 * (@cindy-barnard)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/html-block-and-shortcode-block/)
 * I believe the Gutenberg html block will not support shortcode “as is or out of
   the box”.
 * However, can I securely add a custom plugin or use the “code snippet” plugin 
   to change this function so that a widget_text can support a shortcode?
 * could this example be used as a custom plugin to add a filter to the functions
   file (and if so, is it written correctly):
 *     ```
       <?php
       /*
       Plugin Name: Site Plugin for Custom WP Edits
       Description: Site specific code changes for customwpcedits.com
       */
       /* Start Adding Functions Below this Line */
   
       add_filter( 'widget_text', 'do_shortcode' );
   
   
       /* Stop Adding Functions Below this Line */
       ?>
       ```
   
 * Thank you for any help you can provide!
 * _Cindy
    -  This topic was modified 4 years, 6 months ago by [Cindy Barnard](https://wordpress.org/support/users/cindy-barnard/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  anonymized-14729615
 * (@anonymized-14729615)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/html-block-and-shortcode-block/#post-15160763)
 * What’s the reason for doing this when there’s a shortcode block?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/html-block-and-shortcode-block/#post-15163827)
 * It’s convenient to be able to type a shortcode directly into the current text
   instead of needing to add a separate block for the shortcode. Lazy? Perhaps, 
   but that’s how I roll.
 * Since WP changed to block based widgets I’m not so sure any more, but your code
   ought to work as expected. Try it out and see 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘html block and shortcode block’ is closed to new replies.

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/html-block-and-shortcode-block/#post-15163827)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
