On this page
What this issue is
Every file your server sends comes with a Content-Type header, such as text/html or image/png. Some browsers ignore it and look at the file's contents to guess the type. This is called MIME sniffing (MIME type means the file type label).
The X-Content-Type-Options header with the value nosniff tells the browser to trust the declared type and not guess. Without it, a user-uploaded file labelled as text or an image could be treated as a script if its contents look like one.
Why it costs you leads or sales
A missing header does not break your forms or checkout. The risk is indirect. If your site lets visitors upload files, or serves content from user input, sniffing can help an attacker get a script to run in your visitors' browsers. That can lead to defaced pages, injected redirects or stolen sessions, which hurt trust and conversions.
It also shows up as a warning in security scanners, agency audits and some vendor questionnaires. Fixing it removes an easy objection when a client or partner reviews your site.
- File uploadedLabelled as plain text or an image
- Server sends fileNo nosniff header
- Browser sniffs contentGuesses it is a script
- Script runs on your domainVisitor trust and sessions at risk
Without nosniff, the browser may override the declared file type.
How to check if your site has it
You need to look at the response headers your server sends. Pick one of these methods.
Use your browser
Open your page, open DevTools (F12), go to the Network tab, reload, click the first document request and read Response Headers. Look for x-content-type-options: nosniff.
Or use curl
Run the command below in a terminal and look for the header in the output.
Or use an online header scanner
Free security header testers list the header as present or missing for any URL.
Test more than the homepage
Check a static file (an image or CSS file) and an upload folder URL too. Headers are sometimes set for pages but not for static files, or the reverse.
curl -sI https://www.example.com/ | grep -i x-content-type-options
# Expected: x-content-type-options: nosniffHow to fix it
Set the header once, as high up as you can: at the CDN or web server if you control it, otherwise in the platform or a plugin. Avoid adding it in several places, because duplicates can produce a repeated value like nosniff, nosniff, which some browsers may not accept.
Use server config if you can
On Apache, add the .htaccess rule from the Custom code tab. On nginx, add the add_header line to the server block.
Or use a security headers plugin
Several security and header plugins include an option for X-Content-Type-Options. Enable it, save and clear any cache.
Or use PHP
Add header('X-Content-Type-Options: nosniff'); in a small plugin or your child theme's functions.php inside an init hook. This covers PHP-served pages only, not static files.
Check first
Shopify controls response headers on its own servers, and themes cannot set HTTP headers directly. Test your store with curl, as it may already send the header.
If you use a proxy or CDN in front
Add the header there, for example with a Cloudflare Transform Rule that sets a response header.
Not possible in GTM
GTM runs in the browser and cannot add HTTP response headers. Set the header at your server, CDN or hosting settings instead.
Check hosting settings
Webflow Hosting lets you configure security headers in Site settings, under Hosting. Add X-Content-Type-Options with the value nosniff if it is offered, then publish.
If the option is missing
Put a CDN such as Cloudflare in front and add the header with a response header rule.
Limited control
Funnel and website pages are served by the platform, and custom HTTP headers are generally not editable. Test with curl. If you need the header, put a CDN or proxy in front of a custom domain and add it there.
Platform controlled
Wix sets response headers itself and does not let you add custom ones. Check with curl and, if it is missing, treat it as a platform limit and note it in any audit.
Platform controlled
Squarespace does not offer an option to set custom HTTP response headers. Test with curl. A proxy in front of your domain is the only route, and it adds complexity, so weigh it against the low risk.
Apache (.htaccess or vhost)
Add: Header always set X-Content-Type-Options "nosniff" (requires mod_headers).
nginx
Add in the server block: add_header X-Content-Type-Options "nosniff" always;
Node.js (Express)
Use the helmet package, which sets the header by default, or call res.setHeader('X-Content-Type-Options', 'nosniff').
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
</IfModule>add_header X-Content-Type-Options "nosniff" always;How to confirm it's fixed
- Clear your site, plugin and CDN caches.
- Run the curl command and see x-content-type-options: nosniff once, not twice.
- Check a page, an image and a CSS or JavaScript file.
- Open key pages with DevTools Console open and look for 'blocked due to MIME type' errors.
- Submit your main lead form and run a test checkout to be sure nothing broke.
- Re-run an online security header scan.
Before
- No X-Content-Type-Options header
- Browsers may guess file types
- Security scanners show a warning
After
- X-Content-Type-Options: nosniff on all responses
- Browsers trust the declared file type
- Scanner warning cleared
How to prevent it happening again
Headers often disappear when you change hosts, switch CDN, rebuild a server or reset a plugin. Keep the header in one documented place, ideally in server or CDN configuration kept under version control.
- Record where the header is set (server, CDN or plugin).
- Re-run a header check after migrations, host changes and CDN changes.
- Add the header to your launch checklist for new sites.
- Schedule a monthly or quarterly security header scan.
- Serve uploaded files with correct types and avoid user-controlled content types.
How FunnelGuard handles this
FunnelGuard does not check for the X-Content-Type-Options header today. It is a possible future check.
What FunnelGuard does do is run your real customer journeys, such as lead forms and checkouts, on a schedule and check each step, the tracking hits and whether test leads arrive. If a header change blocks a script or breaks a form, that kind of journey failure is what it is built to notice. It does not tell you the header itself is missing.
To watch for the missing header, run the curl command above after each deploy or host change, or schedule a recurring scan with a free online security header tester. You can also try the free read-only FunnelGuard website audit, and the Free plan covers 1 site and 2 journeys with daily checks and no card.
Frequently asked questions
Questions people ask
What does the X-Content-Type-Options nosniff header do?
It tells the browser to trust the Content-Type your server declares and not guess a file's type from its contents. This stops a file labelled as text or an image from being run as a script. The only valid value is nosniff.
Why does my security scan say X-Content-Type-Options is missing?
The scanner requested your page and found no x-content-type-options header in the response. Your server, CDN or platform is not sending it. Add it at the server or CDN level and scan again.
How do I add X-Content-Type-Options nosniff in nginx or Apache?
In nginx, add add_header X-Content-Type-Options "nosniff" always; to the server block and reload. In Apache, add Header always set X-Content-Type-Options "nosniff" to .htaccess or the virtual host, with mod_headers enabled.
Can nosniff break my website?
Yes, if some files are served with the wrong type. A stylesheet sent as text/plain or a script sent as text/html will be blocked once nosniff is on. Check the browser console for MIME type errors after you add it, and fix the file type on the server.
How do I add X-Content-Type-Options on WordPress?
The cleanest way is a server rule in .htaccess (Apache) or nginx config. If you cannot edit those, use a security headers plugin that has an option for it, or send the header from PHP in a small plugin. Then confirm with curl.
Can I add this header on Wix or Squarespace?
Not directly. Both platforms control their own response headers and do not let you set custom ones. Test with curl, and if you need the header, you would have to put a proxy or CDN in front of your domain.
Is a missing X-Content-Type-Options header a serious problem?
It is low risk on its own. It mainly matters if your site serves uploaded or user-supplied content. It is still worth fixing because it is a one-line change and a common audit finding.
Does FunnelGuard check for the X-Content-Type-Options header?
No. It is a possible future check. FunnelGuard runs your customer journeys and checks forms, tracking and lead delivery, so use curl or an online header scanner to watch this header.
Related issues
- OPS-170Missing Content-Security-PolicyFix guide
- OPS-171Missing X-Frame-Options / frame-ancestors (clickjacking)Fix guide
- OPS-173Missing Referrer-Policy (URLs with PII leak to third parties)Fix guide
- OPS-174Missing Permissions-PolicyFix guide
- OPS-175Cookies without Secure/HttpOnly/SameSiteFix guide
- OPS-155Outdated CMS core with known CVEsFix guide