Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.

Skip to content

How to add security headers with Patchstack?

If you have the Patchstack plugin installed, we will automatically try to inject the security headers into the response.

If this does not work, perhaps due to an aggressive caching plugin or caching/proxy server, you may have to manually add the .htaccess rules below to your .htaccess file.

To automatically add the security headers, you need to navigate to the Patchstack App or Patchstack plugin in your WordPress dashboard.

How to do it in the Patchstack App?

  1. Navigate to your site from the Patchstack App > Sites
  2. Click on the Hardening tab
  3. Click on the .htaccess sub-tab
  4. Switch on the option “Add security headers”
  5. Scroll down and click Save settings

You can manually add the following security headers into the .htaccess file if you use Apache:

<IfModule mod_headers.c>
   Header set Referrer-Policy "strict-origin-when-cross-origin"
   Header set X-XSS-Protection "1; mode=block"
   Header set X-Content-Type-Options "nosniff"
   Header set X-Frame-Options "SAMEORIGIN"
   Header set Strict-Transport-Security "max-age=31536000"
   Header unset X-Powered-By
</IfModule>

If you are running nginx, add the following to the nginx configuration file and restart or reload nginx:

add_header X-Frame-Options SAMEORIGIN;  
add_header X-Content-Type-Options nosniff;  
add_header X-XSS-Protection "1; mode=block";  
add_header Strict-Transport-Security "max-age=31536000";  
add_header Referrer-Policy "strict-origin-when-cross-origin";

Additionally, in order to permanently remove the X-Powered-By header instead of using the above changes, set the expose_php value of your PHP configuration to “Off”. You may have to ask your host to make the above changes.

A more detailed guide about security headers can be found in this article: https://patchstack.com/articles/wordpress-security-headers/

In case you need help, turn to our support chat - just click the green chat bubble at the bottom right corner!

1