Allow inline styles is a checkbox under Style sources in the Aegisify Shield CSP Builder (Pro). When ticked, Shield adds 'unsafe-inline' to style-src. It is off by default.
What “inline” CSS means
Styles written directly in the HTML, such as style="color:red" attributes or <style> blocks, rather than in a separate stylesheet file.
Why WordPress sites often need it
Page builders, block themes, and many plugins generate inline styles for layout and colors. Blocking them can make pages look broken.
The risk
Inline styles are lower risk than inline scripts, but an attacker who can inject HTML can still use styles to overlay fake content, hide warnings, or, in some cases, leak information. Allowing inline styles slightly broadens what injected markup can do.
How to decide
- Enforce
style-srcin Report-Only mode without inline styles. - Review CSP Reports. If many violations come from your theme or builder, allow inline styles.
- If only a few small inline styles appear, consider moving them into the theme stylesheet instead.
Note that the Strict CSP preset also allows inline styles, because so many WordPress themes rely on them.
Shield warns you
Shield shows a warning when inline styles are allowed while style sources are enforced.
Related: CSP style sources, Allow inline JavaScript.
