WordPress Security Headers: What to Check
WordPress serves more than page content: every response also carries instructions that browsers use to handle security-sensitive features. These headers matter to site owners and visitors because they can affect how pages load, how embedded content behaves, and how browsers handle connections and data.
Understanding WordPress security headers makes it easier to judge whether a site’s responses support its security needs without disrupting its features. Here’s what to know about checking them.
Check Your WordPress Security Headers
Before changing any settings, check which security headers your WordPress site already sends. This gives you a clear starting point and helps you avoid adding duplicate or conflicting rules.
Review your WordPress security headers before making changes to spot existing protections and avoid duplicate or conflicting rules.
Use Header inspection tools, such as your browser’s developer tools or a reputable online checker, to view the response headers from your site. Enter your homepage address, then look for headers related to browser protections.
Check a few pages, including a post and a login page, because your hosting setup or plugins may handle them differently.
Run response status checks as well. Confirm each page returns the expected status, usually 200, and note redirects or errors before reviewing its headers.
If you use a caching or security plugin, test with it enabled, then compare results after any changes. Record what you find so you can verify later updates.
Review Your Content Security Policy Rules
Review your Content Security Policy to confirm it allows only the sources your WordPress site needs. Remove unused domains, and block unsafe inline scripts where possible. Test changes on a staging site first so you don’t break features.
Audit Allowed Sources
How do you know your Content Security Policy (CSP) only allows sources your site needs? Review each directive against the files and services your WordPress site actually loads.
Build a CSP source allowlist from a third party origin inventory, then check it regularly as plugins, themes, and services change.
- List origins used for scripts, styles, images, fonts, and connections. Check your browser’s developer tools and network requests.
- Match each origin to a specific feature, such as a payment form or analytics tool. Remove entries you can’t explain.
- Prefer specific hostnames over broad wildcards. A wildcard may permit sources you don’t intend to trust.
- Test changes on a staging site first, then monitor reports and fix legitimate blocked requests before applying them live.
Don’t copy another site’s policy without checking its sources. Your site’s needs may differ, and unused entries can widen access unnecessarily.
Recheck after updates.
Block Unsafe Inline Scripts
A strong Content Security Policy blocks inline scripts by default, so check your rules for unsafe-inline in script-src or default-src and remove it when your site doesn’t need it.
Review and tighten your policy
1. Search your active policy for unsafe-inline, including policies set by WordPress plugins, your host, or a CDN.
If you find it, identify which script needs it before making changes.
2. Replace broad permission with Nonce based script authorization.
Your server adds a fresh, unpredictable nonce to the policy and each approved script tag on every page load. Confirm your WordPress setup can do this consistently.
3. For fixed inline code, use script hash verification.
Calculate a hash for the exact script content, then add it to script-src. Any code change requires a new hash.
4. Test key pages after updates, check browser console errors, and allow only scripts that still work.
Keep a rollback copy in case a needed feature breaks.
Verify HTTPS and HSTS Settings
To verify HTTPS and HSTS settings, check that your WordPress site redirects HTTP visitors to HTTPS and sends an HSTS header only after HTTPS works across the whole site.
Test your homepage, login page, and key pages in a browser, then confirm each loads without certificate warnings.
- Check HTTP to HTTPS redirects from several pages, including links to older URLs.
- Review your TLS certificate renewal date, and make sure renewal happens before the certificate expires.
- Visit pages with images, scripts, and stylesheets, confirm each resource also loads over HTTPS.
- Enable HSTS only after you’ve tested HTTPS across the site and fixed mixed-content issues.
Use a header-checking tool to confirm the HSTS response includes a sensible max-age.
Start with a short period, then increase it once you’re confident. Don’t enable includeSubDomains unless every subdomain supports HTTPS.
Check Clickjacking and MIME-Sniffing Headers
Once HTTPS works across your site, check that two other headers help protect visitors: X-Frame-Options limits whether other sites can embed your pages, reducing clickjacking risk, and X-Content-Type-Options: nosniff tells browsers not to guess a file’s type.
Also review framing and content-type headers: they help prevent clickjacking and stop browsers from misinterpreting files.
Check both headers
Frame embedding controls: Set X-Frame-Options: SAMEORIGIN if your pages should appear in frames only on your own site. Use DENY if no site should frame them.
Check whether a plugin or service needs to embed your pages before choosing. For newer setups, a Content Security Policy with frame-ancestors can offer more control.
MIME type enforcement: Send X-Content-Type-Options: nosniff so browsers follow the declared content type instead of interpreting files as another type. This matters for scripts and stylesheets.
Confirm the server labels those files correctly, then check your response headers in browser developer tools or with an online header checker. Review key pages and assets after changes.
Review Referrer and Permissions Policies
Set a Referrer Policy to control how much page information your WordPress site shares with other sites.
Use Permissions Policy directives to limit access to features like the camera and microphone, then test your headers to confirm they work as intended.
Referrer Policy Settings
Which websites can learn about your visitors from outgoing links? Your referrer policy controls whether browsers share the page address when someone follows a link. Review it to limit referrer leakage, especially if your URLs contain private details or tracking data.
- Choose
strict-origin-when-cross-originas a practical starting point. It sends the full address within your site, but only the site’s origin to other sites. - Use
no-referrerwhen you don’t want browsers to share referrer information with any destination. - Check your WordPress response headers with a browser’s developer tools or an online header checker.
- Test links to both same-site and external pages, then confirm the browser sends only the information you intend.
Set privacy defaults at the server, CDN, or security-plugin level, and check for conflicting rules. Keep the policy consistent across pages.
Permissions Policy Directives
Permissions Policy directives control which browser features your WordPress pages can use, such as the camera, microphone, or location. You can limit these features to reduce unwanted access and give visitors clearer privacy protections.
Review each directive against your site’s actual needs. If no page needs camera access, disable it. If a booking page uses location to show nearby services, allow geolocation only where required. These geolocation controls help prevent other pages or embedded content from requesting location data unnecessarily.
You can set the policy through your web server, hosting dashboard, or a security plugin that supports response headers. Use a restrictive default, then allow specific features only for trusted origins.
Check plugin and theme documentation before blocking a feature they rely on, and keep a brief record of each exception. Avoid broad permissions such as allowing every origin, and update rules when your site’s functions change.
Testing Policy Headers
How can you confirm that your policy headers work as intended? Use browser security testing to inspect the Referrer-Policy and Permissions-Policy headers on your live WordPress pages. Check both the header values and their effects, since a setting can appear correct but behave differently than expected.
- Open your site in browser developer tools, select Network, reload the page, and review the response headers.
- Confirm Referrer-Policy limits referral details as intended when you follow links to another site.
- Test Permissions-Policy by checking whether restricted features, such as camera access, remain unavailable to pages that shouldn’t use them.
- Repeat checks on key page types and after plugin, theme, or server changes.
For more complete policy validation methods, use an online header checker, then verify results in a browser. Test logged-in and public pages when their responses may differ.
If a header is missing or duplicated, check your hosting settings, security plugin, and cache configuration. Recheck after changes.
Test Header Changes and Fix Site Issues
After changing security headers, test your site in a browser and check key pages for errors before making the changes permanent. Use a staging environment first, then review the homepage, login screen, forms, and checkout. Check browser developer tools for blocked scripts, images, or styles. If a feature breaks, adjust the relevant header rule and test again. Keep a rollback plan so you can restore the previous settings quickly.
| Check | What to look for | Next step |
|---|---|---|
| Pages | Missing content | Review header rules |
| Forms | Failed submission | Test scripts |
| Login | Redirect or access errors | Adjust policy |
Test on mobile and desktop, and try more than one browser. Ask another person to verify important tasks, such as logging in or sending a form. Don’t publish the change until key features work as expected.
Recheck Headers After WordPress Updates
WordPress core, theme, or plugin updates can change how your site loads scripts and other resources, so recheck your security headers after each major update.
Recheck your security headers after WordPress updates, as changes to scripts and resources may affect site functionality.
A header that worked before may now block a needed feature or allow more than you intend.
After updating, test key pages on desktop and mobile, then review browser console errors and your header scanner results. Check these areas:
- Confirm your Content Security Policy still permits scripts, fonts, images, and embeds your site uses.
- Look for plugin update effects, such as new third-party scripts that need explicit permission.
- Check for theme update regressions, including broken styles, blocked fonts, or missing images.
- Verify HTTPS redirects, HSTS, and other headers remain active across pages.
If something breaks, adjust one directive at a time, retest, and document the change.
Keep a backup of your working header settings.
Frequently Asked Questions
Can Security Headers Replace WordPress Security Plugins?
No—security headers can’t replace WordPress security plugins. Think of headers as shields, not sentries: you still need security plugin capabilities for scanning, updates, and access protection, alongside layered security controls to defend your site effectively.
Do Security Headers Affect Search Engine Rankings?
Security headers rarely affect your rankings directly; search engines don’t treat them as major ranking signals. However, misconfigured headers can block crawl access, so make sure your settings protect visitors without preventing bots from indexing pages.
Can Security Headers Break Third-Party WordPress Integrations?
Yes, security headers can break third-party WordPress integrations if you restrict scripts, frames, or connections they need. Check Third party script compatibility and API request permissions, then test each integration before deploying changes. You’ll catch conflicts early.
Who Should Configure Security Headers on Managed WordPress Hosting?
Your hosting provider should configure server-level headers, while you handle site owner oversight—like a captain steering with a trusted crew. Clarify Hosting provider responsibilities, test integrations, and coordinate changes so you don’t block essential services or weaken protection.
Are Security Headers Necessary for a Private or Staging WordPress Site?
Yes, you should use security headers on private or staging WordPress sites. How headers help: they limit browser-based attacks. Staging site exposure can happen through misconfigurations, shared links, or public access, so don’t rely on privacy alone.
- HTTP headers
- Website Security
- WordPress security
About the author
Vladimir Mrkela
Senior WordPress Developer
I’m a senior WordPress developer and co-founder of Pixel Industry. I’ve spent more than 12 years building websites, custom plugins, and integrations for all kinds of projects. I enjoy working on complex architecture, solving tricky problems, and sharing what I learn along the way.