Run Shortcode on Widget Title

To run shortcode inside widget title you could add a filter on widget_title

add_filter( 'widget_title', 'do_shortcode' )

Sample usage, example you add [b] shortcode inside widget title:

Make my title [b]bold[/b]

Here’s how we could add some filters in it:

function boldify( $atts, $content = "" ) {
    return "<strong>$content</strong>";
add_shortcode( 'b', 'boldify' );
add_filter( 'widget_title', 'do_shortcode' );


Make my title <strong>bold</strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.