WordPress HTTP security headers and HSTS without server access

Written by

in

WordPress HTTP security headers tell the browser how to treat the site. Don’t guess the file type, don’t let another site frame you, don’t reveal where the user came from. The plugin’s Paranoic Hardening section sends them without asking you to touch the server.

WordPress HTTP security headers: four horizontal lines of different lengths, each starting with a circle, one in purple

Which WordPress HTTP security headers and what they are for

These WordPress HTTP security headers come from the Paranoic Hardening section:

  • X-Content-Type-Options: nosniff makes the browser respect the declared file type.
  • X-Frame-Options: SAMEORIGIN stops other sites embedding yours, against clickjacking.
  • Referrer-Policy: strict-origin-when-cross-origin reduces the information passed to external sites.
  • Strict-Transport-Security (HSTS) makes the browser always use https.
  • Cisilino Site Defense Network: the WordPress security plugin

They go out through WordPress (send_headers) and not through .htaccess. So they also work without mod_headers. They are all off by default.

HSTS is useful and delicate

If one day the site stops being served over https, browsers that have already received HSTS can no longer reach it. That is why the plugin refuses to save HSTS if the save request does not arrive over https. HSTS is one of the WordPress HTTP security headers, so before you switch it on, check the certificate and its renewal. MDN’s page on Strict-Transport-Security explains the header in detail.

Checking that WordPress HTTP security headers really arrive

The Check security headers button makes a real request to the home page and shows which WordPress HTTP security headers are present in the response. It is useful because a CDN or a reverse proxy in front of the site can remove them silently.

Automatic admin logout

The same WordPress HTTP security headers section includes logging administrators out after a period of inactivity, from 60 seconds to 24 hours. Inactivity is measured in the browser, with mouse, keyboard and scrolling, shared across tabs and not on the server side. So WP Heartbeat’s automatic requests aren’t mistaken for activity. When the time is up the session is really closed.

Frequently asked questions

How do I enable HSTS on WordPress?

From the plugin’s Paranoic Hardening section. It is refused if the save request does not arrive over https, to avoid making the site unreachable.

Do these headers need mod_headers?

No. The plugin sends them through WordPress (send_headers), so they also work without mod_headers.

How do I check that WordPress HTTP security headers reach visitors?

With the Check security headers button, which tests a real request to the home page. It can reveal a proxy or CDN that removes them.

Read more

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Cookie Notice by Real Cookie Banner