Skip to content

Instantly share code, notes, and snippets.

@jsumabong
Forked from kjbrum/wp_remove_h1_from_editor.php
Last active March 25, 2020 03:36
Show Gist options
  • Select an option

  • Save jsumabong/f51553b5fddcdd42f6952d112ab3cd93 to your computer and use it in GitHub Desktop.

Select an option

Save jsumabong/f51553b5fddcdd42f6952d112ab3cd93 to your computer and use it in GitHub Desktop.
Remove h1 from the WordPress editor.
<?php
/**
* Remove the h1 tag from the WordPress editor.
*
* @param array $settings The array of editor settings
* @return array The modified edit settings
*/
function remove_h1_from_editor( $settings ) {
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;';
return $settings;
}
add_filter( 'tiny_mce_before_init', 'remove_h1_from_editor' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment