How to strip images from pasted content in the Block Editor? #72491
Unanswered
gion-andri
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
Hi! There's currently no way intercept the paste behavior. Could you elaborate on the use case? Why should images not be pasted? The user can still remove the pasted images? Do you want to prevent images to be inserted in general, or only prevent pasting images? (And if only pasting, why?) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I’m trying to find a way to strip all images when a user pastes external content into the block editor (for example, from another website or a Word document).
I’ve looked for a hook or filter to modify the paste behavior, but I can’t find a clear way to intercept or change what gets passed into the paste handler.
Is there a way to:
pasteHandler, orIdeally, I’d like to remove any
<img>tags (or block equivalents) before they are inserted into the post content.Thanks in advance for any pointers!
Beta Was this translation helpful? Give feedback.
All reactions