---
title: "The old X-XSS-Protection header is switched on"
description: "X-XSS-Protection is deprecated, and the old browser filter it switches on can itself cause security holes."
url: https://ursy.com/issues/x-xss-protection-on/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/x-xss-protection-on/
---

# 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.

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

## Why it matters {#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 {#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 the problem looks like {#what-the-problem-looks-like}

```
X-XSS-Protection: 1; mode=block
```

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

### What it looks like fixed {#what-it-looks-like-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 {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
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/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#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 {#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) {#your-cdn-for-example-cloudflare}

If the [CDN](https://ursy.com/wiki/cdn/) adds security headers for you, check whether it adds this one and change it there.

## Check it is fixed {#check-it-is-fixed}

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

## Official source {#official-source}

[MDN: X-XSS-Protection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-XSS-Protection)

## Questions {#questions}

### Is turning a protection off unsafe? {#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? {#should-i-set-it-to-0-or-remove-it}

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

---

**Cite this page:** The old X-XSS-Protection header is switched on. URSY.com. Updated 30 November 2026. https://ursy.com/issues/x-xss-protection-on/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[The old X-XSS-Protection header is switched on](https://ursy.com/issues/x-xss-protection-on/), URSY.com`. One section: add its id, for example https://ursy.com/issues/x-xss-protection-on/#section-id (every heading above has one).

Section links: https://ursy.com/citations/21/#p-5751 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/x-xss-protection-on/
- As JSON: https://ursy.com/issues/x-xss-protection-on/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
