Check reference

Security headers

What it checks

Checks HSTS, X-Content-Type-Options, clickjacking protection, Referrer-Policy and Content-Security-Policy, the redirect from HTTP to HTTPS, and whether server, PHP or WordPress versions are revealed.

Check ID: external.headers

The response headers of the site address and the additional URLs are checked (following up to 3 redirects). HSTS is checked only for pages served over HTTPS. For the site address, Keep It Peace also opens the http:// address to see whether it is redirected to https://; if port 80 is closed, nothing is reported.

The start of the HTML is read to find the WordPress generator tag.

What a finding means

The titles, severities and explanations below are the ones shown on the Findings screen.

FindingSeverityMeaning
Strict-Transport-Security (HSTS) is not set
headers.hsts_missing
LowWithout HSTS, browsers may still try http:// first, which allows downgrade attacks on public Wi-Fi.
HSTS max-age is short
headers.hsts_short
InfoThe HSTS max-age is less than 180 days.
X-Content-Type-Options is not set
headers.nosniff_missing
LowBrowsers may guess the type of uploaded files and run them as scripts.
Clickjacking protection is not set
headers.clickjacking
LowOther sites can show your pages in a frame and trick visitors into clicking buttons.
Referrer-Policy is not set
headers.referrer_policy
InfoFull URLs, including query strings, may be sent to other sites when visitors follow links.
Content-Security-Policy is not set
headers.csp_missing
InfoA Content-Security-Policy limits where scripts can be loaded from and reduces the impact of XSS.
HTTP is not redirected to HTTPS
headers.no_https_redirect
LowThe site can be opened over unencrypted http:// without being redirected to https://.
The web server version is revealed
headers.server_version
LowThe Server header is "…". Attackers use versions to pick known exploits.
X-Powered-By reveals the PHP version
headers.powered_by
LowThe X-Powered-By header is "…".
The WordPress version is shown in the page source
headers.wp_generator
InfoThe generator meta tag reveals WordPress ….
The site could not be reached for the external check
external.unreachable
InfoThe request failed: …. Previous results of this check are kept until the site can be checked again.

How to fix

The recommended action shown with each finding:

  • Strict-Transport-Security (HSTS) is not set
    Send "Strict-Transport-Security: max-age=31536000" once HTTPS works on all pages and subdomains you use.
  • HSTS max-age is short
    Use max-age=31536000 (one year) once the setting is confirmed to work.
  • X-Content-Type-Options is not set
    Send "X-Content-Type-Options: nosniff".
  • Clickjacking protection is not set
    Send "X-Frame-Options: SAMEORIGIN" or a Content-Security-Policy with frame-ancestors 'self'.
  • Referrer-Policy is not set
    Send "Referrer-Policy: strict-origin-when-cross-origin".
  • Content-Security-Policy is not set
    Start with a Content-Security-Policy-Report-Only header, check the reports, then enforce it.
  • HTTP is not redirected to HTTPS
    Redirect all http:// requests to https:// with a 301 redirect (hosting panel setting or .htaccess).
  • The web server version is revealed
    Hide the version (e.g. ServerTokens Prod for Apache, server_tokens off for nginx) or ask your host.
  • X-Powered-By reveals the PHP version
    Set expose_php = Off in php.ini (or .user.ini), or remove the header in the server configuration.
  • The WordPress version is shown in the page source
    Keep WordPress up to date. You can remove the tag with remove_action( 'wp_head', 'wp_generator' ).
  • The site could not be reached for the external check
    Some hosts block requests from the server to itself (loopback). If the site works for visitors, ask your host to allow loopback requests or disable this check.

Related settings

  • Settings → Checks → Enabled checks: switch “Security headers” on or off.
  • Settings → Targets → Additional URLs for external checks: other URLs on your own domain to check, in addition to the site address. The public URL of a registered directory is checked too.