Why Remove the H1 Option from the WordPress Text Editor Dropdown

The TinyMCE editor allows you to structure the content of your page using headers. These start with H1 and go all the way down to H6 As such, H1 is the biggest of them all, followed by H2 and so on. TinyMCE allows you to select the text style from a familiar drop-down box.

However, the "H1" or "Heading 1" option in the dropdown list is rarely useful in a content and often your h1 tag is already applied to, well - the page title. Therefore, it can hurt your website's SEO. Indeed, search engines treat H1 headings with much more importance than they treat sub-headings and if you use an H1 heading inside your content, you dilute this focus and take the importance away from the title. In addition, best-practice. Only 1 h1 tag per page. For these two reasons, it is a bad idea to have an "H1" heading in the dropdown list, as an author who has no prior knowledge of HTML will create headings and structure their content appropriately, and quite naturally choose "heading 1" as in many ways it seems the most logical to apply as the correct tag to use.

Removing the H1 option completely in WP TinyMCE editor

You can of course ask your authors not to use H1, but they can easily forget this advice or choose it by accident. It is much more useful to remove the option altogether. That way they can't use it by mistake. To achieve this, insert the following small piece of code into your functions.php.

function remove_h1_from_tinyMCE($args) {
	$args['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Pre=pre';
	return $args;
add_filter('tiny_mce_before_init', 'remove_h1_from_tinyMCE' );