Home / Fix guides / Website security

How to add a Permissions-Policy header

The Permissions-Policy header is one line your web server sends with each page to tell browsers which features, such as camera, microphone and location, the page may use. To add it, set a response header like Permissions-Policy: camera=(), microphone=(), geolocation=() in your server, CDN or hosting settings.

A Permissions-Policy header is a short instruction your website sends to every visitor's browser. It says which browser features the page, and anything embedded in it, is allowed to use. If it is missing, your site still works normally, but the browser falls back to its default rules for every feature. Adding the header usually takes one line of configuration.

What the problem is and what you see

Visitors will not notice anything. The problem only shows up in a security scan or a header checker, usually worded as "Missing Permissions-Policy header".

The header controls browser features such as the camera, microphone, location (geolocation), payment requests, fullscreen and USB access. It replaced an older header called Feature-Policy, so you may see both names mentioned in older guides. Use Permissions-Policy.

Why it matters

Be clear about the size of this issue: a missing Permissions-Policy header is a hardening gap, not an open door. Your site is not broken or hacked because of it. But it is worth fixing because:

  • Security: many sites load third party code, such as chat widgets, ad scripts, embedded maps and videos. The header lets you say your site does not need the camera or microphone, so that code cannot ask for them through your pages.
  • Trust and sales: security scanners flag it, and so do the security questionnaires some larger customers send. A clean result saves awkward questions.
  • Search: this is not something you need to fix for search rankings. Treat it as a security and housekeeping task.

How to check if your site has it

There are three free ways.

  1. Open a terminal and run curl -I https://www.example.com (use your own address). Look for a line starting with permissions-policy: in the output.
  2. In Chrome, Edge or Firefox, open your site, press F12, go to the Network tab, reload, click the first request (your page) and look under Response Headers.
  3. Enter your address in the free checker at securityheaders.com. It lists which security headers are present and which are missing.

If none of these show a Permissions-Policy line, the header is missing.

How to fix it in general

The header is added where your server, CDN or host sends responses. A safe starting value is:

Permissions-Policy: camera=(), microphone=(), geolocation=()

Each feature is followed by a list of who may use it. Empty brackets () mean nobody, including your own pages. The word self (no quotes) means your own site. Other sites go in quotes. For example:

Permissions-Policy: camera=(self), microphone=(), geolocation=(self "https://maps.example.com")

The main rule is to block only what you do not use. If your site has a video call, a store locator that asks for location, or a payment feature, allow those. If you are not sure, start with the short list above and test your key pages afterwards. Features you leave out of the header keep the browser's default behaviour, so a short list is a safe start.

How to add it on common platforms

Menu names differ between versions, so treat these as pointers.

Nginx. Add this inside the server block of your site configuration, then test and reload with nginx -t and systemctl reload nginx:

add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;

The full steps are in the Nginx guide.

Apache. Make sure mod_headers is enabled, then add this to your virtual host or .htaccess file:

Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"

See the Apache guide for details.

WordPress. WordPress has no built in setting for this. The usual routes are the server config above (ask your host if you cannot edit it), a security headers plugin, or a small code snippet in a child theme or site specific plugin. Check that any plugin you pick is actively maintained.

Cloudflare. In the dashboard, look for Rules, then Transform Rules, then Modify Response Header. Add a rule that sets a static header named Permissions-Policy for all requests to your hostname.

Netlify. Add a _headers file to your published folder with a /* line followed by the header, or use the [[headers]] section in netlify.toml.

Vercel. Add a headers entry in vercel.json with source set to /(.*) and your header in the list.

Next.js. Use the headers() function in next.config.js to return the header for all paths.

If you use a CDN or proxy in front of your server, set the header in one place only. Setting it in both can produce duplicates, which browsers may handle badly.

How to confirm the fix worked

  1. Run curl -I on your address again and check the permissions-policy line appears with your value.
  2. Check more than the home page: a product page, a contact page and a page with embedded video or maps.
  3. If you use a CDN, clear its cache first, as old responses may be served without the header.
  4. Click through anything that uses the camera, microphone, location or payments, and confirm it still works.
  5. Open the browser console (F12) and look for warnings about unrecognised features. They are harmless but show a typo or an unsupported name.

How to stop it coming back

The header often disappears after a server move, a new CDN, a hosting change or a rebuilt configuration file. To keep it:

  • Keep your server or host configuration in version control, or at least a saved copy, so a rebuild includes the header.
  • Re-check your headers after any hosting, CDN or DNS change.
  • Fix related headers at the same time, such as the Referrer-Policy header, since they are set in the same place.
  • Rescan on a schedule. Week 2 of SiteMonday is an OpenVAS security scan that reports this header if it goes missing, and it runs only after you prove you own the site with a DNS record or a file. See week 2. SiteMonday finds and explains the problem; adding the header is for you or your developer.

Step by step for your platform

Questions

Is a missing Permissions-Policy header a serious vulnerability?

Not on its own. It is a hardening measure that limits what embedded and third party content can do, so it is usually rated low risk. It is still worth adding because it is quick and often flagged by scanners.

Will adding the header break my website?

Only if you block a feature your site really uses, such as location for a store finder or the microphone for a call widget. Start with a short list, add only what you do not need, and test your key pages.

What is the difference between Permissions-Policy and Feature-Policy?

Feature-Policy was the older name and used a different syntax. Permissions-Policy replaced it, so use the new header for current browsers.

Do I need this header on every page?

The simplest approach is to send it on all responses. It matters most on HTML pages, which is where browser features are requested.

Can I add the header on shared hosting without server access?

Often yes. On Apache hosting you can usually add it to the `.htaccess` file, and many hosts offer a header setting in their control panel. If neither works, ask your host's support.

How do I allow my own site to use a feature?

Put `self` inside the brackets with no quotes, for example `geolocation=(self)`. To allow another site, add its address in quotes, such as `"https://maps.example.com"`.

Related problems