FM 3-1 · Fix guides

How to add security headers on WordPress, Wix, Squarespace, GHL and Shopify

3 min readUpdated By Chris Moore, USMC veteran and founder

BLUF · Bottom line up front

Security headers are a few lines your server sends with every page that tell browsers to block common attacks. On WordPress (or anything behind Cloudflare) you can add them all in 15 minutes. On Wix, Squarespace, GHL and Shopify you mostly can't, and that's okay.

Security headers are standing orders your site gives every visitor's browser: only talk to me over HTTPS, don't let other sites frame me, don't guess file types. They are invisible to visitors and cost nothing. Here are the ones your report checks:

HeaderWhat it stopsSafe starting value
Strict-Transport-Security (HSTS)Anyone downgrading a visitor to plain, unencrypted httpmax-age=31536000; includeSubDomains
X-Frame-OptionsClickjacking: your site loaded invisibly inside another siteSAMEORIGIN
X-Content-Type-OptionsBrowsers treating an uploaded file as a scriptnosniff
Referrer-PolicyFull page addresses leaking to other sitesstrict-origin-when-cross-origin
Permissions-PolicyEmbedded scripts quietly asking for camera, mic or locationcamera=(), microphone=(), geolocation=()
Content-Security-PolicyInjected scripts running on your pagesStart report-only, see below

What each platform allows

WordPressFull fixFull control through a plugin, your host, .htaccess or Cloudflare.
Any site on CloudflareFull fixTransform Rules can add headers to any site whose traffic runs through Cloudflare.
ShopifyPartialNo custom headers. Shopify sends HSTS and several protections itself.
SquarespacePartialNo custom headers. Squarespace handles HTTPS and HSTS for you.
WixPartialNo custom headers. Wix handles HTTPS and several protections itself.
GoHighLevelPartialNo header settings on GHL sites and funnels.

Content-Security-Policy, carefully

CSP is the strongest header and the easiest to get wrong. A strict policy can break your chat widget, your booking tool and your analytics in one shot. Roll it out like a careful advance: start with Content-Security-Policy-Report-Only, watch what it would have blocked for a week, then switch to enforcing. If that sounds like more than you want to manage, skip CSP. It is weighted low in your score for exactly this reason.

The orders: WordPress or any site on Cloudflare

  1. Back up and confirm HTTPS works everywhere

    Take a backup. Then open your site on http:// and make sure it redirects to https:// on every page. HSTS locks browsers into HTTPS, so HTTPS must be solid first.

  2. Pick one place to set headers

    Choose one: a security headers plugin, your host's control panel (many managed WordPress hosts have a headers or security screen), your server config, or Cloudflare. Setting the same header in two places can send it twice, which some browsers ignore.

  3. Add the five basic headers

    Apache or LiteSpeed hosts can add them to .htaccess:

    <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-Content-Type-Options "nosniff"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
    </IfModule>

    On nginx, use add_header ... always; lines in the server block. On Cloudflare, go to Rules, Transform Rules, Modify Response Header, and add each header with Set static.

  4. Hide software versions

    If your report says headers announce your server or PHP version, ask your host to turn off expose_php and set ServerTokens Prod (Apache) or server_tokens off (nginx). On Cloudflare, a Transform Rule can remove X-Powered-By.

  5. Test, then re-scan

    Click around your site: forms, booking, checkout, chat. If anything is embedded on another site of yours and stops showing, X-Frame-Options is the likely cause. Then run a new scan. Your Hardened checklist should show the headers as passing.

Questions from the field

Will security headers break my website?

The five basic headers almost never do. The one exception is X-Frame-Options if you embed your own site inside another one. Content-Security-Policy can break things, which is why you start it in report-only mode.

Can I add security headers on Wix or Squarespace?

Not custom ones. Both platforms manage the server and handle HTTPS themselves. Make sure HTTPS is switched on for your domain and focus your time on fixes you control, like speed and content.

Do security headers help SEO?

Not directly. HTTPS is a light ranking signal and HSTS protects it, but the real payoff is trust and fewer ways to get hacked, and a hacked site loses its rankings fast.

Still stuck? Send us your question. A real person answers, Monday to Friday.

Keep reading