Remove “Line indent” and “Fit text” in WordPress 7.0
Published: – Leave a comment
In WordPress 7.0, two new typography settings arrived within the block editor to set a line indentation and use the “Fit text” feature. The latter already has been part of WordPress 6.9 as block style. For me, such settings are usually not necessary for most people. Thus I show you how you can remove them in your theme.
Functionality description
The line indentation is used to indent the first line of a paragraph. This is usually been done in books and similar and not widespread on the internet.
The fit text feature automatically adjusts the font size of the text to match the whole available space of a single line. Thus, the text will never break into a new line. This may look cool, but depending on the text length can either be very big on desktop or very small on mobile devices.

Both settings can be found in the typography panel within the styles tab of supported blocks. For line indent, it works on paragraph blocks, while fit text is available for paragraph as well as heading blocks.
Remove the features
Line indentation can be removed via the theme.json by setting settings.typography.textIndent to false:
{
"$schema": "https://schemas.wp.org/wp/7.0/theme.json",
"version": 3,
"settings": {
"typography": {
"textIndent": false
},
}
}Code language: JSON / JSON with Comments (json)
Fit text on the other hand can currently only disabled by filtering the block supports of the particular blocks via PHP:
function disable_fit_text_blocks( array $metadata ): array {
$blocks = [ 'core/paragraph', 'core/heading' ];
if ( \in_array( $metadata['name'], $blocks, true ) ) {
$metadata['supports']['typography']['fitText'] = false;
}
return $metadata;
}
\add_filter( 'block_type_metadata', 'disable_fit_text_blocks' );Code language: PHP (php)
Afterwards, these settings are no more available in the typography styles settings.
Likes
Reposts