{"id":12963,"date":"2021-06-04T10:30:15","date_gmt":"2021-06-04T07:30:15","guid":{"rendered":"https:\/\/vipestudio.com\/?p=12963"},"modified":"2021-06-11T10:28:02","modified_gmt":"2021-06-11T07:28:02","slug":"how-to-block-malicious-ip-addresses-in-wordpress","status":"publish","type":"post","link":"https:\/\/vipestudio.com\/en\/how-to-block-malicious-ip-addresses-in-wordpress\/","title":{"rendered":"How to Block Malicious IP Addresses in WordPress"},"content":{"rendered":"<p style=\"text-align: left;\">Welcome back to part 2 of this series on IP Address Blocking from your trusty WordPress agency for development, Vipe Studio.<\/p>\n<p style=\"text-align: left;\">In the previous part, we explored what it means to block IPs, and when you might need to do it. Today, we\u2019ll look at a couple of methods, so let\u2019s get to it!<\/p>\n<h2 style=\"text-align: left;\">IP address blocking in WordPress<\/h2>\n<p style=\"text-align: left;\">Last time, we noted down a list of IP addresses from the WordPress dashboard that we wanted to block. To do so, follow these 3 steps:<\/p>\n<ul style=\"text-align: left;\">\n<li>Copy over the list of IPs that you wish to block and paste them into a new text file. It\u2019s always advisable to resort to copy and paste, as we don\u2019t want a stray typo or two that could <strong>let some IPs off the hook<\/strong>, and blacklist others instead.<\/li>\n<li>Open up the dashboard on WordPress and click on \u2018Settings\u2019, then \u2018Discussion\u2019, and you\u2019ll see settings for your website comments. Scrolling will bring you to the \u2018Comment Blocklist\u2019, where you can use a variety of criteria such as keywords or URLs or emails\u2026or IP addresses. Any comment that contains or is from the IP address you paste here will be moved to trash.<\/li>\n<li>Copy the list of IP addresses from the text file we created, and paste them into this section, ensuring that each IP is on a separate line. \u2018Save Changes\u2019 will set the blocking process in motion.<\/li>\n<\/ul>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\" wp-image-12978 aligncenter\" src=\"https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-300x300.png\" alt=\"\" width=\"256\" height=\"256\" srcset=\"https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-300x300.png 300w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-1024x1024.png 1024w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-150x150.png 150w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-768x768.png 768w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-410x410.png 410w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-381x381.png 381w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai-174x174.png 174w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3818549-ai.png 1500w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/p>\n<h2 style=\"text-align: left;\">Blocking IPs from a country<\/h2>\n<p style=\"text-align: left;\">Sometimes we want to block access to the website for users from a country (or many) \u2013 either because the website is designed with some culture in mind, or perhaps you\u2019re getting a lot of<strong> ill-intentioned visitors from<\/strong> a country. To achieve this, we will need plugins.<\/p>\n<p style=\"text-align: left;\">Search for \u2018iQ Block Country\u2019 under \u2018Add New\u2019 in Plugins in the dashboard, install it, and activate it.<\/p>\n<p style=\"text-align: left;\">Next, you\u2019ll be shown a notification that tells you how you can get a database file to be uploaded. The notification will show you how the paid version works if you\u2019d like that, but for now, we\u2019ll be discussing the free database. Head over to <a href=\"httpsdev.maxmind.comgeoipgeoip2geolite2\" target=\"_blank\" rel=\"nofollow noopener\">Maxmind<\/a> and create an account, then log in.<\/p>\n<p style=\"text-align: left;\">Here, you can pick \u2018Download Databases\u2019, and scroll till you find the database named \u2018GeoLite2 Country\u2019, then download it.<\/p>\n<p style=\"text-align: left;\">Using compression software like 7-Zip, extract the database and copy the file \u2018GeoLite2-Country.mmd\u2019. After this, the mmdb file needs to be uploaded to wp-content uploads on your website, ideally over <a href=\"httpsvipestudio.comenusing-sftp-for-file-management-on-wordpress\" target=\"_blank\" rel=\"nofollow noopener\">SFTP<\/a>.<\/p>\n<p style=\"text-align: left;\">This uploaded database plugs into the IQ Block Country plugin, and you can now pick countries. It\u2019ll check the country of every IP address that visits you, and block the ones that are from regions you\u2019ve picked.<\/p>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"size-medium wp-image-12980 aligncenter\" src=\"https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-300x200.png 300w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-1024x683.png 1024w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-768x512.png 768w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-615x410.png 615w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-572x381.png 572w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai-261x174.png 261w, https:\/\/vipestudio.com\/wp-content\/uploads\/2021\/05\/3848294-ai.png 1500w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p style=\"text-align: left;\">To do this, return to the iQ Block Country plugin settings and choose whether you\u2019d like the block to apply to your website frontend, backend, or both. Let\u2019s use \u2018Frontend\u2019 for now, so under that tab, select from the dropdown menu which countries you\u2019d like to block traffic from. As always \u2018 Save Changes\u2019 will <strong>work the magic<\/strong>, and your blocking will be in place.<\/p>\n<p style=\"text-align: left;\">That concludes this two-part tutorial series on IP address blocking on your WordPress website, and we hope you found it useful. It goes without saying that a reputable development agency would take care of IP address blocking as part of their security services, so if you\u2019re in two minds about hiring a WordPress agency for development, this could help you make up your mind about it.<\/p>\n<p style=\"text-align: left;\">That\u2019ll be all from us at <a href=\"https:\/\/vipestudio.com\/en\/wordpress-inquiry\/\">Vipe Studio<\/a> for now, and we\u2019ll meet you next time when we\u2019ll bring you more such guides and tips!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome back to part 2 of this series on IP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12976,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[142],"tags":[902,389,836,903,837,390,258,475],"class_list":["post-12963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-common-issues","tag-block","tag-hacks","tag-ip-address","tag-ip-adresses-blocking-in-wordpress","tag-malicious-ip-address","tag-malware","tag-security-en","tag-wordpress-agency"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts\/12963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/comments?post=12963"}],"version-history":[{"count":0,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/posts\/12963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/media\/12976"}],"wp:attachment":[{"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/media?parent=12963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/categories?post=12963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vipestudio.com\/en\/wp-json\/wp\/v2\/tags?post=12963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}