Blog / Web management /

WordPress security headers: a beginner’s guide

Someone sends you a security scan with a red badge and a list of “missing headers”. The tempting move is to paste the suggested values into your server and move on. Don’t. That’s how a secure-looking site ends up with a checkout that no longer loads.

A security header is just an instruction your server sends to the browser. It can reduce certain risks, but it isn’t a magic shield. On WordPress, start by finding out which headers your host, CDN and plugins already send. Then decide which risk you’re addressing and test the change on staging.

What headers do

HTTP response headers carry instructions between a server and a browser. The security ones influence how the browser loads content, handles framing, interprets content types or upgrades connections. They sit alongside updates, access controls and backups. They don’t replace them.

You’ll meet names like Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, Referrer-Policy and Permissions-Policy. Older advice also pushes X-Frame-Options or X-XSS-Protection without saying much about browser support or modern alternatives. Check current guidance and understand each directive before you adopt it.

Inspect before changing anything

Check the live headers for your homepage and a few important templates: an article, a form, a login page and, if you have one, checkout. Browser developer tools will show them. Write down what’s already sent and where it comes from: WordPress, the host, a CDN or a security plugin.

Headers can differ by URL or cache state, so the homepage alone won’t tell you the whole story. Behind a CDN, work out whether the origin or the CDN controls the final response. When I pick up a site, I want to know which layer owns the headers before I touch anything, because editing the wrong one gives you duplicate or conflicting instructions.

Start with policies you understand

X-Content-Type-Options with the nosniff value tells browsers not to guess content types. Referrer-Policy controls how much referrer information goes out when a visitor follows a link. Both are fairly simple, but check that they don’t upset your analytics or any legitimate external flow.

Strict-Transport-Security tells browsers to use HTTPS on future visits. Don’t set a long duration or include subdomains casually. First check that every subdomain supports HTTPS and that your redirects are right. A mistake here can make a site hard to reach for returning visitors.

Content-Security-Policy restricts which sources a page may load from. It’s powerful and easy to get wrong. A WordPress site can load scripts from its theme, plugins, payment services, analytics and consent tools. I’d start in report-only mode if it’s available, review the violations, then refine before enforcing. A copied wildcard policy is not a substitute for mapping what your site actually loads.

WordPress-specific checks

Plugins and themes add scripts and embeds on the fly. A policy that works on the homepage can fail on a page with a video, a form, a payment button or the editor preview. Test a representative set of templates, plus the logged-in admin, not only public pages.

If a security plugin or your host already manages headers, two tools may send duplicate values or overwrite each other. Note the exact setting, where it lives and how to roll it back. If you can’t tell which layer is responsible, ask your host before changing server configuration.

And never edit a live server file without a backup. One syntax error can take the site offline. On managed hosting, use the documented control or go through support.

Test the site after the change

Open the pages that rely on external scripts, forms and embeds. Submit a form, run a safe test transaction if the site takes payments, and check that the dashboard still works. Then inspect the headers again to confirm the policy is really there.

Watch the browser console for blocked resources. A violation can be a real security signal, or it can be a legitimate dependency you forgot to allow. Don’t silence every warning blindly. Find the source and decide if it belongs.

Send a useful security report

A scanner flagging a missing header isn’t an instruction to paste a value into production. Record the URL, the header you saw, the suggested policy and the layer that should own the change. Ask whether the finding matters for this site’s real risks and dependencies. I’d rather hand over a note that explains risk and side effects than a grade with a red badge.

If a team maintains the site, put a line in the change log and tell whoever does the testing. When a directive blocks a legitimate checkout or embed, the damage can outweigh the theoretical protection. Make the trade-off knowingly, then schedule a review so the strict rule doesn’t sit forgotten.

FAQ

Do security headers secure WordPress by themselves?

No. They are one layer. Keep WordPress, themes and plugins updated, use strong account controls, protect backups and follow your host’s security guidance.

Can a security header hurt SEO?

It is not a ranking shortcut. A broken policy can block content or functionality that visitors and crawlers need, so test carefully.

Should I use a plugin to add headers?

A plugin can help if you understand what it configures and how it interacts with your host or CDN. Avoid duplicate controls and keep a rollback plan.

Inspect the headers on one page of your site today and write down which service controls them. Do you know yet where the change would have to be made?