Skip to content

Allow setting default preview for HTML blocks #40913

Closed

Description

@Gierand

What problem does this address?

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.

Activity

  1. added
    [Type] Enhancement
    [Block] HTML
    on May 8, 2022
  2. added
    [Status] In Progress
    on May 13, 2022
  3. Evakos commented on Nov 11, 2022

    @Evakos

    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.

  4. mauteri commented on Jan 1, 2023

    @mauteri
    Contributor

    I put in a PR to make this change here: #46834

  5. wilnau-design commented on Jan 22, 2024

    @wilnau-design

    +1

  6. daviedR commented on Feb 10, 2024

    @daviedR
    Contributor

    +1

  7. removed their assignment
    on Feb 12, 2024
  8. skorasaurus commented on Sep 8, 2026

    @skorasaurus
    Member

    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

  9. kenji-hayakawa-gh commented on Oct 8, 2026

    @kenji-hayakawa-gh

    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.

  10. youknowriad commented on Oct 9, 2026

    @youknowriad
    Contributor

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] HTML[Status] In Progress[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions