How to Enable WordPress Shortcodes in Text Widgets

By ThemesDNA1 min read

Share:

WordPress does not enable shortcodes in text widgets by default. But it would be fairly simple to enable them because a text widget's text passes through a filter called "widget_text." To enable shortcodes inside WordPress text widgets, add this shortcode to your theme's functions.php file:

add_filter( 'widget_text', 'do_shortcode' );
Premium WordPress themes One-time payment   /   Lifetime updates

Ready to Build?

Get the ThemesDNA bundle.

Get all premium ThemesDNA themes with lifetime updates and unlimited website usage for a one-time payment.

  • 56 premium themes
  • Lifetime updates
  • Unlimited websites
  • No renewals

The complete premium theme bundle

$75

One payment. No renewals.

Get the ThemesDNA Bundle — $75