Blocking WordPress VPN, Proxy Logins and Spam Bots
Hello, in this article we will tell you about one of the essentials. Security for WordPress sites We will show you the most important process on behalf of. Thanks to this process, you will be able to block the attackers who will log in to your site with Proxy and VPN. You will also be able to completely eliminate spam hits. We will briefly explain you step by step. Blocking WordPress VPN logins and we will explain the method of blocking WordPress proxy entries. As a result of this process, Block WordPress Spam Hits'We will be in trouble. If we do not do these operations, your site wordpress spam By blocking bots and fake hits, they will cause serious damage to your site by entering. This is definitely a procedure we recommend.
- First, let's access our files via FTP or cPanel.
- Let's find our .htaccess file in the main directory and right-click it to select Show/Edit.
- Let's add the code below to the bottom line of our opened file as shown in the image.
[sociallocker id=”6670″]
-
# NETTACOMPANY WEB SOLUTIONS SECURITY CENTER
RewriteEngine on
RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule ^(.*)$ – [F]
# protect xmlrpc
RedirectMatch 403 /xmlrpc.php
[/sociallocker]
- Then, add the following code to the top line of /public_html/wp-content/themes/hereyourthemename/header.php (Your theme's header PHP file), as shown in the image.
-
<?php if(@fsockopen($_SERVER[‘REMOTE_ADDR’], 80, $errstr, $errno, 1)) die(“Proxy&VPN Entries are Blocked by NettaCompany Web Solutions.”); ?>
- Then I'll say Save and complete the process. That's it.
Thanks to the process we have done, we have closed another security hole in WordPress and completely blocked both spam and VPN and proxy logins.
Thank you, it was an effortless procedure.
There is a detailed explanation about spam.
Thanks for the useful article.
Thank you for this information.
Hello.
I added the codes you gave me because I had the same problem.
There is no problem with the code added to the .htaccess file, but the code I added to the header.php file causes the site to go white screen.
Also when I write it in cpanel it gives an error on the code.
https://hizliresim.com/dOGy2Z as in the screenshot.
why it may be caused.