Guardian WebBlogHow to Protect Your PHP Site in 5 Minutes with Guardian Web

How to Protect Your PHP Site in 5 Minutes with Guardian Web

Installing a security shield on your PHP site does not have to be complicated. This step-by-step guide shows you how to have your site protected in under 5 minutes.

13 Apr 2026 Guardian Web 5 min

Web security is often seen as something complex, reserved for experts. The truth is that the most common attacks — brute force, vulnerability scans, malicious bots — can be blocked with very little effort if you have the right tools.

In this guide we show you how to protect any PHP site, including WordPress, with Guardian Web in under 5 minutes.

What do you need?

Step 1 — Create your account and add your site

Register at app.guardianweb.es. Once inside, go to My Sites → Add site and enter the domain you want to protect. The system will generate a unique API key for that domain.

Step 2 — Download the shield

From your site dashboard, download the gw-shield.php file. It is a single PHP file containing all the protection logic. No external dependencies, no installation required.

Step 3 — Upload the file to your server

Connect via FTP (or use your hosting file manager) and upload gw-shield.php to the root of your project, next to your index.php.

Step 4 — Add one line of code

Open your index.php (or wp-config.php for WordPress) and add this line at the very top, before any other instruction:

<?php
// Add this line at the top of index.php
require_once __DIR__ . '/gw-shield.php';

// The rest of your code continues here...

For WordPress, the line goes in wp-config.php:

<?php
// In wp-config.php, as the very first line
require_once ABSPATH . 'gw-shield.php';

// define('DB_NAME', ...

Step 5 — Verify it works

Go back to the Guardian Web panel and open the Logs section for your site. If the shield is active, you will see the first requests appearing in real time. The site status indicator will turn green.

What does the shield protect from the start?

Next steps

With the shield installed, you can explore the advanced features of the panel:

If you have any questions during installation, open a ticket from the panel and we will help you.

← Back to blog
Share: