Website Protection for WordPress

PHP mode

Updated over a week ago

Before start, make sure you have read about Website Protection General Settings.

Website Protection without Redirect

1. In the General campaign settings, select 301 redirect for users as Without.

2. Go to the Website Protection tab.


3. Download the PHP-script to your computer, then transfer this file to the hosting and connect it on your website. You will see in the archive a script with a name like 146-15FeYt. For convenience, change the name to, for example, scr.php. Upload this file to your hosting in the root directory.

Install the module for Wordpress Include me and activate.

4. Create botuser.php file. Connect the script to this file and write the following code (line 2 and 3 from the PHP script tab in the company settings):

<?php include("Path to file"); ?> <?php if(\BotDetecter::isBot()){ ?>Block shown to the bot<?php } ?> <?php if(\BotDetecter::isNotBot()){ ?>Block displayed to the user<?php } ?>

5. Place the scr.php script file, botuser.php content file in your Wordpress root folder.


6. Go to the Wordpress panel under Pages / Posts.

7. Open the required page in edit mode.

8. Switch to text mode.

9. Write the following code:

[includeme file="botuser.php"]

Website Protection with Redirect

1. In the General campaign settings, select 301 redirect for users as To URL. In the field that appears, specify the site URL that will only be displayed to users.

2. Go to the Website Protection tab.

3. Download the PHP script to your computer, then transfer this file to the hosting and connect it on your website. You will see in the archive a script with a name like 146-15FeYt. For convenience, change the name, for example, to playok. Upload this file to your hosting.


Find the index.php file in the root directory and open it in edit mode.

4. Add the following code at the beginning of the file (line 2 and 4 from the PHP script tab in the campaign settings):

<?php include("playok.php"); ?> <?php \BotDetecter::redirectIfNotBot(); ?>

Setting up with a redirect to a separate page of the site

Configure the same way as for Without redirect.


In the botuser.php file, add the following code at the beginning of the file (line 2 and 4 from the PHP script tab in the campaign settings).

<?php include("playok.php"); ?> <?php \BotDetecter::redirectIfNotBot(); ?>
Did this answer your question?