Smart Paste Cleanup
Pasting content from external sources often introduces unwanted styles and inconsistent formatting. The Block Editor provides a powerful cleanup mechanism with customization options to maintain consistency and security.
Features
- Removes inline styles for cleaner markup.
- Preserves semantic structure like headings and paragraphs.
- Converts rich text into clean blocks for easy editing.
- Extracts links and mentions without clutter.
Customization options
You can configure paste cleanup behavior using the following settings:
- PlainText
- KeepFormat
- AllowedStyles
- DeniedTags
Events
Hooks for before and after paste actions:
Paste modes
- Keep Format: Retains allowed styles and structure.
- Plain Paste: Strips all styles and converts to plain text.
Why cleanup matters
Clean content improves:
- Readability: No distracting styles.
- Accessibility: Proper semantic tags.
- Consistency: Uniform styling across platforms.
- Security: Prevents malicious scripts or embeds.
Tip: Use paste cleanup to remove inline styles while retaining semantic structure.
Clean content is clear content.
Workflow
- Paste content from external sources.
- Review the cleaned output.
- Apply additional formatting if needed.
- Save and publish.
Insert Link
Properties