Archived topic
When editing in Gutenberg remove the title from the editing interface
14 replies · Started by Jacob on September 26, 2021
Hi again.
When using Gutenberg oyu give the option to turn of the post title. But I do not want it in the editing interface at all. Do you have a way to remove it ? I mean - I can always add a Heading to the page or post myself, so it just clutters and messes with the almost clean full-page editing experience we know from page builders.
Can you fix it ? Will you incorporate this in the future ?
Hi Jacob,
The theme doesn't control the UI fields and layout of Gutenberg Editor.
At most, GP Premium only adds Layout Metabox to the UI but the rest is either WordPress core UI or from another plugin.
To add: it's actually important to leave the post title field enabled and have it filled because SEOs fetch this value for the metadata. If you turn this field off, there'd be no way to add the post title conveniently. The posts will literally have no title.
While I understand that you can always add an H1 element inside the content, that h1 tag is content. It's not a post title WordPress can dynamically fetch for SEO and post listing purposes. :)
I know. But in elementor they do not display title when editing. The titletag is preserved and set elsewhere. But when making a landing page it frustrates me to have it their.
The quickest workaround is by running this PHP snippet to your site.
add_action( 'enqueue_block_editor_assets', function() {
$css = '.edit-post-visual-editor__post-title-wrapper {
display: none;
}';
wp_add_inline_style( 'generate-block-editor-styles', $css );
}, 100 );
This basically adds this CSS to the block editor:
.edit-post-visual-editor__post-title-wrapper {
display: none;
}
Which hides the post title fields to all things you edit within Gutenberg.
In code snippets plugin or what do you mean, when you say "running this php snippet to your site" ?
Yes that's right. You can paste the PHP snippet on a Code Snippets plugin or a child theme's functions.php.
Awesome. Checking later.
Let us know how it goes. :D
Awesome. Worked. Of course it did. Thank you Elvin. Again.
No problem. Glad to be of any help. :D
Hi gentlemen-
I tried Elvin's fix and it doesn't appear to work. I ran the snippet and still the content title still appears in the editor (although I've disabled the content title). Is there another solution? thanks!
Please refer to the image here- https://pasteboard.co/QTCiKzMsK9dE.png
Hi there,
you can try this PHP Snippet to hide the title in the editor:
add_filter( 'block_editor_settings_all', function( $editor_settings ) {
$css = '.edit-post-visual-editor__post-title-wrapper {
display: none;
}';
$editor_settings['styles'][] = array( 'css' => $css );
return $editor_settings;
} );
David! That snippet did the trick.
thank you!
You're welcome
Cwicly :)
https://youtu.be/xgoRc59alfE?t=582
Notice the Add Title in the top - Cwicly is awesome. Full on Gutenberg.