You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow setting default preview for HTML blocks #40913
It is not possible to set the default state to preview mode for HTML blocks.
What is your proposed solution?
As we begin to brand our WordPress site within the FSE area of WordPress, it would be nice if the HTML blocks had a “mode” option to default its initial state to preview, rather than edit mode. This way we can get a “proper” visual of the site as we see it in FSE. Clicking preview mode on an HTML block every single time we are in FSE begins to become a distraction.
Reacted by Suzie, Germán Freixinós, Niels van Amstel, Dossy Shiobara, jia sheng and brainrot-coder-3000
I noticed that setting the HTML block to preview doesn't work anyway. In my case I had added Font Awesome icons like this: and also a . However converting it to a block does allow the preview although you have to then override the styling of .wp-block-code. So a temporary solution appears to be converting the block.
Showing the preview of the HTML block is now the default option for HTML blocks; this was introduced in #73108 (wordpress 7.0) although this may change in the future as there is some pushback from editors (#80843 ; #79316 , #78576 , and #78507
Forcing one default view on all users will always make the other side unhappy, so giving users the choice of default view along the lines of #46834 feels like the best approach. Also, denying users the option to edit the code directly in-line (without the modal) is causing additional issues, such as this and this.
This is actually how the HTML block works now, so I'm closing this issue. For folks that want the code by default I shared a plugin here #79316 (comment)
Activity
Evakos commentedon Nov 11, 2022
I noticed that setting the HTML block to preview doesn't work anyway. In my case I had added Font Awesome icons like this: and also a . However converting it to a
block does allow the preview although you have to then override the styling of .wp-block-code. So a temporary solution appears to be converting the block.mauteri commentedon Jan 1, 2023
I put in a PR to make this change here: #46834
wilnau-design commentedon Jan 22, 2024
+1
daviedR commentedon Feb 10, 2024
+1
skorasaurus commentedon Sep 8, 2026
Showing the preview of the HTML block is now the default option for HTML blocks; this was introduced in #73108 (wordpress 7.0) although this may change in the future as there is some pushback from editors (#80843 ; #79316 , #78576 , and #78507
kenji-hayakawa-gh commentedon Oct 8, 2026
Adding #83020 as another example of pushback.
Forcing one default view on all users will always make the other side unhappy, so giving users the choice of default view along the lines of #46834 feels like the best approach. Also, denying users the option to edit the code directly in-line (without the modal) is causing additional issues, such as this and this.
youknowriad commentedon Oct 9, 2026
This is actually how the HTML block works now, so I'm closing this issue. For folks that want the code by default I shared a plugin here #79316 (comment)