1. Home
  2. Knowledge Base
  3. WordPress
  4. Include security headers in the .htaccess

Include security headers in the .htaccess

Include security headers in the .htaccess


To add HTTP response headers in WordPress, you just need to add the following lines to your .htaccess file.

First, log in to your WordPress hosting account and go to the root folder of your WordPress site from there. Then search for the .htaccess file and edit it.

As this is a (.) file, it may be hidden. If you cannot find the .htaccess file in the root folder, go to the settings and click on “Show hidden files”.

Now insert the following line at the end:

Header set Strict-Transport-Security "max-age=31536000" env=HTTPS

Header set X-XSS-Protection "1; mode=block"

Header set X-Content-Type-Options nosniff

Header always append X-Frame-Options SAMEORIGIN

Header referrer policy: no-referrer-when-downgrade

After adding, save the file and your security headers are integrated.

Dieser Beitrag ist auch verfügbar auf: Deutsch (German)

Was this article helpful?

Related Articles

Submit a Comment

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

Published on - 12. Mar 2021
Modified on - 29. Mar 2024
Views - 47
Likes - 0

Do you need help?

Kontaktiere uns gerne :-)
Contact Support
Skip to content