HTTP Security Header WordPress Plugin
HTTP Security Header is a WordPress.org plugin by Mohit Goyal in PHP that adds CSP, HSTS and security headers from a settings screen, now at 1,000+ installs.
Timeline
Stack
About the project
It exists so that site owners can pass a security header scan without editing server configuration they are rightly afraid to touch. Most WordPress sites fail security header scans. The fix is well known, but adding headers means editing .htaccess or the server config. Site owners will not touch that, and many agencies would rather not be responsible for it. The result is that sites stay exposed to clickjacking, content sniffing and cross-site scripting that a few response headers would mitigate. I wrote this plugin so that anyone can turn on the important headers from Settings > Security Headers, with sensible defaults and validation, and without a trip into the hosting panel. The plugin covers Strict-Transport-Security (HSTS), Content-Security-Policy (CSP), X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, X-XSS-Protection, X-Permitted-Cross-Domain-Policies and Feature-Policy. Each header has its own settings with defaults that are safe to switch on, and the values are validated before they are saved. The part I care most about is the fallbacks. A bad Content-Security-Policy or a mistyped frame option cannot lock an admin out of their own site, because the plugin falls back to a working value rather than serving a header that breaks the dashboard. I published it to WordPress.org in November 2024 and have shipped updates through version 3.1. It is built in PHP for WordPress 5.0 and above. It sends headers from WordPress itself rather than from the web server, which makes it portable across Apache, Nginx and managed hosts where the owner has no config access. The settings screen uses the standard WordPress settings API, so it behaves like core and is easy to audit. Around the plugin I wrote a 15-article explainer series covering each header in turn. The series doubles as documentation and as the content that brings people to the plugin. I also built a companion online scanner on inspiredmonks.com that grades a site from A+ to F, so an owner can see the problem before installing the fix. At the time of writing the plugin reports more than 1,000 active installs, about 6,900 downloads and a 5 out of 5 rating on WordPress.org. Site owners who could never have edited a server file can now pass a header audit in a few minutes. Agencies I work with install it as a standard part of a build. The lesson from maintaining it has been that safe defaults and fallbacks matter more than coverage. A plugin that cannot break a site gets left switched on. Need a WordPress plugin built or hardened for your own site or product? Send me the requirements and I will reply with a plan.