Articles on: Advanced Solutions

How to use Shortcodes In WordPress Widgets

How to use Shortcodes In WordPress Widgets



By default, WordPress does not allow the use of shortcodes in widgets. This is not a big problem as WordPress also makes it easy for you to enable this functionality. If you have the ability to do so, you will need to add a line to your functions.php file.








add_filter('widget_text', 'do_shortcode');


Or if you want to add shortcodes to the widget title



add_filter( 'widget_title', 'do_shortcode' );

Updated on: 23/11/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!