How To Disable Typography Option in WordPress 5.9

It’s very simple to disable it, you can simply drop this in your theme functions.php or add it in your plugin.

add_action(
	'after_setup_theme',
	function() {
		add_theme_support( 'editor-font-sizes', [] );

		add_filter(
			'block_editor_settings_all',
			function( $editor_settings, $context ) {
				$editor_settings['__experimentalFeatures']['typography']['fontWeight'] = false;
				$editor_settings['__experimentalFeatures']['typography']['letterSpacing'] = false;
				$editor_settings['__experimentalFeatures']['typography']['textTransform'] = false;
				$editor_settings['__experimentalFeatures']['typography']['fontStyle'] = false;
				return $editor_settings;
			},
			10,
			2
		);
	}
);

How to Disable Drop Cap Settings?

You can simply add this code:

$editor_settings['__experimentalFeatures']['typography']['dropCap'] = false;

Leave a Reply

Your email address will not be published.

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