Aegisify company logo

We're Here to Help

Resources & Help Center

Search our knowledge base, view documentation, or get support. Everything you need in one place.

Should I allow inline CSS in my Aegisify Shield CSP?

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

  1. Enforce style-src in Report-Only mode without inline styles.
  2. Review CSP Reports. If many violations come from your theme or builder, allow inline styles.
  3. 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.

2026-12-01T03:49:32+00:00January 13th, 2026||

Find this article interesting, please share.