Blocking IP Addresses From Accessing Websites in Plesk

1. Log Into Your Plesk Panel


2. Select ‘Files’

Plesk websites and domains page

3. Select the Relevant Folder

Go into the folder that holds the website files for the website you want to add the protection to.


4. Go to ‘More’ then ‘View Options’

Plesk files screen with view options dropdown highlighted

5. Tick ‘Show system files and directories’

Plesk screen file manager settings modal

6. Create a ‘.htaccess’ File

If a file named ‘.htaccess’ doesn’t already exist, click on the ‘+’ button and select ‘Create File’ from the drop down.

Name the file ‘.htaccess’ and leave the ‘Use the HTML template’ unticked. Now select the ‘OK’ button to create the file.

Plesk file manager screen, with create file highlighted

7. Edit Your File

Plesk file manager screen with edit option highlighted

8. Blocking IP’s

If you want to block access to your entire website, add the following line of code:

Deny from 123.123.123.123

Replace the 123.123.123.123 with the IP address that you want to block

If you want to block access to a singular page, use the following lines of code:

<Files "page.php">
deny from 123.123.123.123
</Files>

Once again replacing the 123.123.123.123 with the IP address you wish to block

Web Hosting shortcode

Was this article helpful?
Please Share Your Feedback
How Can We Improve This Article?
Table of Contents