Title: allow wordpress shortcode in wp_kses()
Last modified: August 22, 2016

---

# allow wordpress shortcode in wp_kses()

 *  Resolved [dvpl](https://wordpress.org/support/users/dvpl/)
 * (@dvpl)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/allow-wordpress-shortcode-in-wp_kses/)
 * Hi,
    I have used wp_kses() function on the_content() as :
 * echo wp_kses(get_the_content(), $allowed_html );
 * According to need allowed tags are working fine except wordpress shortcode ex:[
   shortcode].
 * shortcodes are printing as it is written in backend content area. I need them
   to work as usual.
 * I need your valuable help.
    Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [dvpl](https://wordpress.org/support/users/dvpl/)
 * (@dvpl)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/allow-wordpress-shortcode-in-wp_kses/#post-5878379)
 * Greetings!
 * I found a solution and that is :
    Replace
 * > echo wp_kses(get_the_content(), $allowed_html );
 * BY
 * > $content = wp_kses(get_the_content(), $allowed_html );
   >  echo do_shortcode($
   > content);
 * Thanks for the support.

Viewing 1 replies (of 1 total)

The topic ‘allow wordpress shortcode in wp_kses()’ is closed to new replies.

## Tags

 * [KSES](https://wordpress.org/support/topic-tag/kses/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [dvpl](https://wordpress.org/support/users/dvpl/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/allow-wordpress-shortcode-in-wp_kses/#post-5878379)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
