How to disable TinyMCE from removing span tags

[*]

I couldn’t find the extended_valid_elements option in the settings panel for TinyMCE advanced, but adding the following to my functions.php solved it:

function override_mce_options($initArray) {
    $opts="*[*]";
    $initArray['valid_elements'] = $opts;
    $initArray['extended_valid_elements'] = $opts;
    return $initArray;
} add_filter('tiny_mce_before_init', 'override_mce_options');

Source

[*]

Leave a Comment