Block User By IP Address Jeffrey T. Kastner | May 20, 2015 I had a client, who recently was having an issue with receiving contact form spam on their website and they asked me what they could do, to stop that from occurring. Unfortunately, there isn’t a tool built into the Weebly editor that would allow you to block the person submitting that spam. However, Weebly does display the IP Address of the user who submitted the Form entry AND the Blog Post comments. In most cases, no-one really wants to restrict access to their website. If you want your website visible to the general public, and you want people to be able to contact you via your website, you certainly can’t restrict access to your contact page. This idea dramatically changes when somebody repeatedly spams your contact forms or blog posts. If you have been a victim of receiving spam messages on your website, you are probably thinking; “I know exactly what you mean!” In my search to see what I could do to help my client stop the hundreds of spam contact form submissions they were receiving, I learned that blocking an IP Address can only really be done if you are using a “server-side language”, such as PHP, something that can’t be used on a lot of web builders such as Weebly. The good news is, there are services out there that can provide you with an embeddable code that will work, by simply copying the code that they provide and pasting it into the code section of the site, or page. Well, I found a solution. One that not only worked, but it also provides a few other features that can be helpful. Like the ability to direct blocked users away from your website, to somewhere like Google.com The IP Address Approval system will work with a number of website builders such as Blogger, WordPress, Squarespace, Wix and Weebly, to name a few. And what more, you can block IP Addresses, for free. If you’re using Weebly, like I am, while editing your Weebly site simply visit the Weebly App Center by clicking on the “App” link at the top of the Weebly editor, in the navigation menu, or in the Settings > My Apps > and click on the “Go to App Center” link in the upper right corner. *If you are a student or a teacher using the education platform you may not have access to the App Center. In the App Center the search feature to search for “IP” or “IP Approval”, and click on the card for that app and on the app page click the Add the button and then continue, and then sign up to connect your account. Make sure to publish your site when you are done. (see step one below) If you’re not using Weebly, here are a few simple instructions to set this up on your own site. Keep in mind these are basic instructions, but should be enough to get you started! 1. Sign Up Create an account on the Sign Up page. http://www.ip-approval.com/sign-up Simply enter your First & Last Name, a Username and your Email and they will send you a temporary password. Or, you can also use the Google or Facebook Sign-Up options. Note: That a temporary password will be emailed to you. 2. Access the IP Address EditorOnce you have successfully created your account, log in and click the ‘Manage IP Addresses’ link, or the IP Editor navigation link. 3. Add the Banned IP Addresses On the IP Editor page, locate the Banned IP’s section and simply enter one IP address per line and then click the Save Changes button. Use a single IP Address or an IP Range: 1. Wildcard: 1.2.3.* 2. CIDR: 1.2.3/255 OR 1.2.3.4/255.255.255.0 3. Start-End: 1.2.3.0-1.2.3.255 4. Set the Site/Page to redirect the Banned Users On the IP Editor page, next to the Banned IP’s box, set the page or website that you wish to redirect the unwanted visitors to. You can set this to be whatever you would like. Then Save your changes. Note: by default this is set to take unwanted visitors to a page of your website /banned.html Keep in mind that changing this setting, so the unwanted visitor is redirected to http://www.google.com or a different website, would require that you upgrade to the paid version of this service. 5. Copy Embeddable Code If you are using Weebly, and are not able to host this yourself, you can use the JavaScript Embeddable Code found at the bottom of the IP Editor page. 6. Add Code to your Site Once you have copied your unique embeddable code link, from the IP Editor, go to the Pages tab of the Weebly editor and select the page you wish to restrict access to, then click Advanced Settings. Scroll down in the Advanced Settings, and paste the embeddable code into the Header Code section. Then, be sure to click the Save & Edit button to save your changes. 7. Create a ‘Banned’ page If you are using the IP Address Approval systems default page settings you’ll need to create a page on your site titled Banned. Click the Save & Edit button, and add a message to the content area of your Banned page. Then, make sure to Publish the changes to your site. For this example, I’ve created a “IP Address Test Page” and I am using the IP Address Approval systems ‘other’ feature that allows you to Close your website but Remain Open for specific IP addresses. Note: Because your IP address is NOT on the list of allowed IP addresses, you are not going to have access to the “IP Address Test Page”. But give it a try, by clicking the link below… https://www.jeffreytkastner.com/ip-address-test-page IP Address Test Page Create your IP Approval account here: http://www.ip-approval.com/sign-up Tweet 18 Comments Zinga says: October 6, 2016 at 8:47 am *My website is still in development* This is really cool… I keep getting spams on my post comments, and all i could do until now were delete them. Thanks! Reply Maurice says: October 31, 2016 at 10:26 am I just wanted to say thank you for this post. You deserve a gold medal! It saved me a lot of headaches Reply devid says: December 8, 2016 at 9:31 am Can I use it on blogger site? Reply Jeffrey Kastner says: December 9, 2016 at 1:41 am I do believe that you can! While I’m not familiar with Blogger, as long as they provide a place to add code to the ‘head’ of the page or site (where you would place meta tags), you can add it there. Or, worse case, you could add it to the content area by embedding the code if they only offer that. Note: its best to add it to the top of the page (preferably in the head section). Reply T says: April 10, 2017 at 8:29 am Can you tell me if there is a way to pull an IP address from an Order for the IP block? I have an over abuser of free content not following rules and wish to block them. Thanks! Reply Jeffrey Kastner says: April 10, 2017 at 5:03 am Hi T, IF the product is a Digital Good, Weebly logs the Downloads, and I believe they provide the IP Address then, however, they do not currently provide the IP Address for each person making the purchase. If money is being exchanged, you may be able to get that info from the Payment Processor. If you would like to see this added to each order, I would recommend submitting a “feature request”, to see if it is something they can add in the future… https://community.weebly.com/t5/Vote-on-Features Reply T says: April 10, 2017 at 7:25 am Thanks so much for getting back to me, appreciate the help! Reply T says: July 24, 2017 at 2:51 am Thanks so much! Reply K says: July 24, 2017 at 1:02 am Hi there , Does this work with Wix?? Thank you so much ! Reply Jeffrey Kastner says: July 24, 2017 at 1:34 am Yes, this will work with any hosting platform that allows you to add JavaScript to the ‘Head’ code section of the website. Reply Craig says: June 21, 2018 at 6:42 am Hi Jeffrey , I’ve added an ip number that I want banned but is that all there is to it? I’ve left the other fields in default – Access Denied Page and – Banned IP Page. But it says I should make a page that says banned on my website, I don’t understand, because this page shows up when on my website and doesn’t look good. I am hoping just the ip number under the Banned List is good enough? But where do they directed to? Thanks Reply Jeffrey Kastner says: June 21, 2018 at 6:48 am Hey Craig, I’ve sent you an email with answers to your questions. If you don’t see that in your email inbox, please be sure to check your spam or junk folder. Reply Fai says: July 10, 2018 at 7:11 am Hi, thank you so much for sharing this post with us. Have you experienced slow loading after adding the code? It seems to slow down my website. Reply Jeffrey Kastner says: July 10, 2018 at 4:06 am Hi Fai, I have not experienced that. It’s possible there is an issue with your settings, some broken code, or maybe something temporary with IP Approval site or your account? I didn’t get your website URL, to test, but if you are still experiencing problems it would probably be best to reach out to their support for assistance. Reply Kay says: December 9, 2020 at 10:04 am Hi, thank you for this helpful information. How does one find a customer’s IP address on Squarespace? Thanks again. Reply Jeffrey Kastner says: February 5, 2022 at 12:17 pm Usually IP Addresses are provided with Contact Form Entries, Blog Post Comments or Product Orders (depending on the platform). Reply n says: February 4, 2022 at 9:36 am DO NOT use this with squarespace. It blocked even me out of the account even to delete code when i hadnt even added any ip addresses yet Reply Jeffrey Kastner says: February 4, 2022 at 10:24 am Clearly you did not follow the Squarespace instructions, namely the one where it says **Please take note: If you do not change your “Built In Domain” to match the custom domain, or disable the code injection scripts in the Squarespace editor, our service will automatically redirect you from the Squarespace editor to an “Unauthorized Domain” page** https://www.ip-approval.com/squarespace-instructions#built-in-domain Trust me, I’ve used this on Squarespace and if you follow the directions properly it will work! .. PS, now that you are being redirected you may have to clear your browser cache in order for it to stop. Reply Write a Reply or Comment Cancel replyYour email address will not be published. Required fields are marked *Name * Email * Website Comment * Save my name, email, and website in this browser for the next time I comment.