Get the free theme
View Categories

My Scripts or Styles Are Being Stripped

3 min read

Table of Contents

If you paste markup with a <style> or <script> tag and it comes back missing after saving, the cause is almost always the editing account, not Canvas.

WordPress only keeps raw script and style for accounts with the unfiltered_html capability. On a standard single-site install, administrators have it. Accounts without it have script and style stripped on save. This is WordPress core behavior that applies to every theme, and Canvas passes your markup through as written.

What to check

  • Confirm you’re editing as an administrator on a standard install.
  • On WordPress multisite, note that unfiltered_html is restricted further, so even some administrators may not have it.
  • If the account is correct and markup is still stripped, a security plugin or host-level filter may be removing it.

For the underlying rule, see the unfiltered_html article in the theme section.

<lc-toy:sanitizer>
<p>Set the clock to the 8:14.</p> <script>startClock();</script> removed on save
capable users (admins) keep their markup intact without the capability, the script is stripped before saving