javascript – Change (replace) tags to tags

Wanted to change / replace all my “b” tags ~ bold tags to “strong” tags in wordpress.

I used some JS snippets to achieve it but they are not making them work.

Snippets used,


function change_b_to_strong($content){
    str_replace('<b>', '<strong>', $content);
    str_replace('</b>', '</strong>', $content);
    return $content;
    return '<h2> working??? </h2>';

add_filter( 'the_content', 'change_b_to_strong' );


add_filter('tiny_mce_before_init', 'modify_formats');

function modify_formats($settings){
   $formats = array(
     'bold' => array('inline' => 'b'),
     'strong' => array('inline' => 'strong')
    $settings('formats') = json_encode( $formats );
    return $settings;