Piotr Sikora - Logo - Automatyzacja procesów | AI | JavaScript | Front End | Team Leader
  • Home
  • Services
    • Process Automation
    • AI for Lawyers
  • Blog
  • Quotes
  • Contact
PL/EN

HTTP Security Headers: Change Headers in WordPress

  • Home
  • Blog
  • HTTP Security Headers: Change Headers in WordPress
HTTP Security Headers: Change Headers in WordPress

By Piotr Sikora

  • automatic-tests

  • 3 min read

Table of Contents

  • How to check HTTP Headers
  • Starting point for piotr-sikora.com
  • Check if securityheaders.com has proper HTTP Headers
  • Installation of HTTP Headers plugin and configuration
  • Final result - Score B
  • Summary: Recommended security HTTP Headers check

Do you want to set HTTP security headers in WordPress? X-Content-Type-Options, X-XSS-Protection, X-Frame-Options, Referrer-Policy, Permissions-Policy, Strict-Transport-Security

After last workshop about security I wanted to check how to use the knowledge in live project.

To check how it works I've tried to use two scenarios:

  1. https://developer.wordpress.com/docs/tutorials/add-http-headers/ - to change HTTP Headers using custom-redirects.php file

  2. https://docs.wpvip.com/infrastructure/http-headers/ - to change HTTP Headers using functions.php file

None of them worked on my side...

But finally I've found a plugin: https://wordpress.org/plugins/http-headers/

How to check HTTP Headers

To check important from security side HTTP Headers it's good to use this website:

https://securityheaders.com

Website gives you information about used by domain Security Headers.

Starting point for piotr-sikora.com

Below you can see that scanning of my website looked like one big red flag.

HTTP Headers for Security - How to change HTTP headers in WordPress step 1

Additionally I wanted to be sure that my headers are available so I've created a short Jupyter Notebook in Python:

import requests

url = "https://piotr-sikora.com"

response = requests.get(url)

# Print all headers
for header in response.headers:
    print(header, ":", response.headers[header])
    # print(header)

After running this code list of my headers:

Server : nginx
Date : Sun, 01 Sep 2024 14:39:16 GMT
Content-Type : text/html; charset=UTF-8
Transfer-Encoding : chunked
Connection : keep-alive
X-Powered-By : PHP/8.1.29
Link : <https://piotr-sikora.com/wp-json/>; rel="https://api.w.org/"

Check if securityheaders.com has proper HTTP Headers

The shoemaker's son always goes barefoot so... let's check if the website itself has all HTTP Headers set as well:

HTTP Headers for Security - How to change HTTP headers in WordPress step 2

... and let' treat it as a goal for a website.

Installation of HTTP Headers plugin and configuration

First of all I've installed WP Plugin:

https://wordpress.org/plugins/http-headers/

After checking the report, I began changing the appropriate headers step by step. You can see the settings in the plugin:

HTTP Headers for Security - How to change HTTP headers in WordPress step 3

After that I've entered first link - SECURITY:

HTTP Headers for Security - How to change HTTP headers in WordPress step 4

Each listed header has a set of options ready to use. To access them, click 'Edit' at the end of the line. For example, the X-Frame-Options header.:

X-Frame-Options header configuration in HTTP Headers WordPress plugin

X-XSS-Protection header:

X-XSS-Protection header configuration in HTTP Headers WordPress plugin

Final result - Score B

After all changes possible with HTTP Headers WordPress plugin report from :

Security headers scan result showing Score B rating

And from Jupyter Notebook script:

Server : nginxDate : Sun, 01 Sep 2024 15:26:25 GMTContent-Type : text/html; charset=UTF-8Transfer-Encoding : chunkedConnection : keep-aliveX-Frame-Options : SAMEORIGINX-XSS-Protection : 1; mode=blockStrict-Transport-Security : max-age=2592000Content-Security-Policy : default-src https:; script-src https:; style-src https:; img-src https:; connect-src https:; font-src https:; media-src https:; report-uri https:; child-src https:; form-action https:; frame-ancestors https:; object-src https:; frame-src https:; worker-src https:; manifest-src https:; navigate-to https:; prefetch-src https:; base-uri https:Referrer-Policy : same-originPermissions-Policy : autoplay=()X-Powered-By : PHP/8.1.29Link : https://piotr-sikora.com/wp-json/; rel="https://api.w.org/"

Summary: Recommended security HTTP Headers check

  • X-Content-Type-Options
  • X-XSS-Protection
  • X-Frame-Options
  • Referrer-Policy
  • Permissions-Policy
  • Strict-Transport-Security

Share this article

TwitterLinkedInFacebook

Tags:

  • #cybersecurity

  • #http

  • #http-headers

  • #http-security-headers

  • #permissions-policy

  • #referrer-policy

  • #security

  • #strict-transport-security

  • #wordpress

  • #x-content-type-options

  • #x-frame-options

  • #x-xss-protection

Categories

after-hours(1)AI(7)ai-en(1)angular(4)automatic-tests(1)Automation(2)cryptography(1)css(8)CyberSecurity(2)Development(6)DevOps(1)events(3)javascript(11)n8n(10)ollama(1)security(2)seo(1)

Recent Posts

Testing Kimi Code: First Impressions from Web and CLI

Development

Testing Kimi Code: First Impressions from Web and CLI

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

Automation

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

DRY, WET, AHA: Finding the Right Balance in Code Reuse

Development

DRY, WET, AHA: Finding the Right Balance in Code Reuse

API vs Webhook: Understanding the Difference

Development

API vs Webhook: Understanding the Difference

RTCROS Framework: Structure Your Prompts for Better AI Results

AI

RTCROS Framework: Structure Your Prompts for Better AI Results

About Me

Piotr Sikora - Process Automation | AI | n8n | Python | JavaScript

Piotr Sikora

Process Automation Specialist

I implement automation that saves time and money, streamlines operations, and increases the predictability of results. Specializing in process automation, AI implementation, and workflow optimization using n8n, Python, and JavaScript.

n8n Workflows

n8n workflow automation templates

Explore my workflow templates on n8n. Ready-to-use automations for blog management, data collection, and AI-powered content processing.

3Workflow Templates
View Templates

• Auto-Categorize Blog Posts with AI

• Collect LinkedIn Profiles

• Export WordPress Posts for SEO

Tags

activepiecesafter-hoursahrefsaiAI cost reductionai-agentsai-automationangularantigravityapiAqua Securityarcade-gamesarchitectureautomationbackendbest-practicescadillacs-and-dinosaurschatbotchatgptCI/CD
“An intellectual says a simple thing in a hard way, an artist says a hard thing in a simple way.”
Charles Bukowski
View more quotes

Similar Articles

Discover more related content

WordPress: Disable XML-RPC What It Is and Why It's Important

WordPress: Disable XML-RPC What It Is and Why It's Important

Learn what WordPress XML-RPC is, why xmlrpc.php is a security risk, and how to disable it using .htaccess.

n8n Workflow: Export WordPress Posts for SEO

n8n Workflow: Export WordPress Posts for SEO

n8n workflow for content manager and SEO specialists

26 October 2025
Removing Unwanted Files from Your WordPress Server

Removing Unwanted Files from Your WordPress Server

I had a chance to work with one of websites which was affected by hackers attack

Piotr Sikora | ai | n8n | javascript | python

Let's get to know each other!

Get in touch with me
Piotr Sikora | Process Automation  | AI Implementation 🤖 | Technology Consulting
Quick links
  • Home
  • Blog
  • Contact
Contact
  • piotr.sikora.ck@gmail.com
  • +48 505 684 661

© Piotr Sikora 2026 | All Rights Reserved