Skip to content

Shop page doesn't allow HTML tags inside the Custom HTML block #52103

@Aljullu

Description

@Aljullu

Reported in https://wordpress.org/support/topic/css-displayed-in-frontend/.

In classic themes, the Shop page is not handling the Custom HTML block as other pages are. That means that tags like <style> and <script> are printed as plain text instead of being applied to the page.

Steps to reproduce

  1. In a classic theme, create a page with the Custom HTML block and some content inside <style>, <script> or similar tags:
<style>p { color: red; }</style>
<p>Hello world</p>
<script>alert('test');</script>
  1. Save the page and open it in the frontend. Notice the alert appears and the <p> has the correct styles:
    Image
  2. Go to WooCommerce > Settings > Products and set the page you created as the Shop page.
  3. Reopen the page in the frontend and notice the HTML tags are displayed as plain text:
    Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThe issue is a confirmed bug.KirigamiWC Store Editing (FSE)Store FrontendIssues related to shop page.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions