Skip to the content
Start free

The old X-XSS-Protection header is switched on

X-XSS-Protection is deprecated, and the old browser filter it switches on can itself cause security holes.

Low priority Security and HTTPS

Why it matters #

X-XSS-Protection switched on a cross-site scripting filter in older browsers. Modern browsers have removed that filter. MDN marks the header deprecated and warns that the filter could itself create holes on sites that were otherwise safe.

Content-Security-Policy now does the job this header was meant to do, and does it far better.

How to fix it #

Send "X-XSS-Protection: 0", or remove the header. The OWASP secure headers guidance recommends 0. Put the effort into a Content-Security-Policy instead.

The header often comes from an old security plugin or a server template that has not been updated for years. Check with the Security Headers Checker.

What it looks like, and fixed #

The problem
X-XSS-Protection: 1; mode=block

Switches on an old browser filter that modern browsers have removed and that could itself be misused.

Fixed
X-XSS-Protection: 0

Or leave the header out. Protect the site with a Content-Security-Policy instead.

Fix it with your AI assistant #

Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.

Your instruction for the AI
Help me update an old security header on [your website address], which runs on [your platform or server, e.g. WordPress on Apache]. A checker says X-XSS-Protection is switched on. Modern browsers have removed the filter it controls, and in older browsers that filter could create holes on pages that were otherwise safe. First check: run "curl -sI https://[your domain]/" (or ask me to paste the headers) and find every place that could add this header: server configuration, .htaccess, a security plugin, the theme, the CDN or the application code. Explain plainly where it comes from. Then give me the exact change: set "X-XSS-Protection: 0" or remove the header, at its source, once. Rules: back up first, change only this header, keep every other security header, and do not remove a Content-Security-Policy. Give the exact line to change and where it lives. Finally, tell me to re-check with the URSY.com Security Headers Checker at ursy.com/security-headers-checker/.

We find the problems, and help you fix them

  1. Check Run a free tool or the full audit.
  2. Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
  3. Re-check Come back, check again, and watch each fix turn green.

How the AI Fix Pack works, with a sample to download

Fix it on your platform #

WordPress

Old security plugins often add this header. Look for an X-XSS-Protection option and set it to 0 or off.

Your server or hosting

Search the server configuration and .htaccess for X-XSS-Protection and change the value to 0, or remove the line.

Your CDN (for example Cloudflare)

If the CDN adds security headers for you, check whether it adds this one and change it there.

Check it is fixed #

Run the Security Headers Checker again: X-XSS-Protection should be 0 or absent.

Official source #

MDN: X-XSS-Protection

Questions #

Is turning a protection off unsafe?

No. Current browsers ignore it, and 0 stops older browsers using a filter that could be abused. A Content-Security-Policy is the real protection.

Should I set it to 0 or remove it?

Either is fine. Security header guidance recommends 0, which makes the choice clear.

More problems in Security and HTTPS

See every problem in the library

For AI assistants and developers: Instructions for AI · Developers · How to cite URSY.com