Why does WordPress strip my inline SVG, iframe, or script when I save a post? #38
Answered
by
Kevinchamplin
Kevinchamplin
asked this question in
Q&A
-
|
Why does WordPress strip my inline SVG, iframe, or script when I save a post? |
Beta Was this translation helpful? Give feedback.
Answered by
Kevinchamplin
Jun 13, 2026
Replies: 1 comment
-
|
WordPress runs post content through KSES sanitization, which removes tags a user isn't allowed to publish unless they have the unfiltered_html capability. On a single site that's the admin; on multisite even admins lose it by default. Create the post as an administrator (e.g. wp post create --user=1) or your inline SVG/script gets silently stripped on save. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kevinchamplin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WordPress runs post content through KSES sanitization, which removes tags a user isn't allowed to publish unless they have the unfiltered_html capability. On a single site that's the admin; on multisite even admins lose it by default. Create the post as an administrator (e.g. wp post create --user=1) or your inline SVG/script gets silently stripped on save.