You can block malicious IP addresses in WordPress using several effective methods:
-
Manually Block IPs via WordPress Dashboard
Navigate to Settings → Discussion in your WordPress admin panel. Scroll to the “Disallowed Comment Keys” or “Comment Blacklist” section and paste the suspicious IP addresses. This prevents those IPs from posting comments but does not block site access entirely. -
Block IPs Using cPanel’s IP Blocker
Log in to your hosting account’s cPanel, go to the Security section, and select IP Blocker. Enter the IP address or IP range you want to block and add it. This method blocks the IPs from accessing your entire website at the server level, providing stronger protection against malicious traffic. -
Use Security Plugins
Install a security plugin like All-In-One Security (AIOS) that automatically detects and blocks suspicious IP addresses. These plugins often include firewalls and other tools to protect your site from malware and attacks without manual IP management. -
Block IPs via .htaccess File
Edit your WordPress site’s .htaccess file (located in the root directory) to deny access to specific IPs. For example, to block a single IP, add:<Limit GET POST> order allow,deny deny from 123.45.67.89 allow from all </Limit>To block multiple IPs or ranges, add multiple
deny fromlines or specify partial IPs to block ranges. This method blocks access at the web server level and is very effective but requires careful editing and backups to avoid site issues.
Summary Table
| Method | Scope of Blocking | Ease of Use | Notes |
|---|---|---|---|
| WordPress Discussion Settings | Blocks commenting only | Easy | Does not block site access |
| cPanel IP Blocker | Blocks entire site access | Moderate | Server-level blocking |
| Security Plugins | Automated detection & blocking | Easy | Requires plugin installation |
| .htaccess File Editing | Blocks entire site access | Advanced | Powerful but requires careful handling |
Each method serves different needs: for comment spam, use WordPress settings; for full site blocking, use cPanel or .htaccess; for automated protection, use security plugins. Always back up your site and files before making changes, especially when editing .htaccess or server settings.










Ang PH Ranking ay nag-aalok ng pinakamataas na kalidad ng mga serbisyo sa website traffic sa Pilipinas. Nagbibigay kami ng iba’t ibang uri ng serbisyo sa trapiko para sa aming mga kliyente, kabilang ang website traffic, desktop traffic, mobile traffic, Google traffic, search traffic, eCommerce traffic, YouTube traffic, at TikTok traffic. Ang aming website ay may 100% kasiyahan ng customer, kaya maaari kang bumili ng malaking dami ng SEO traffic online nang may kumpiyansa. Sa halagang 720 PHP bawat buwan, maaari mong agad pataasin ang trapiko sa website, pagandahin ang SEO performance, at pataasin ang iyong mga benta!
Nahihirapan bang pumili ng traffic package? Makipag-ugnayan sa amin, at tutulungan ka ng aming staff.
Libreng Konsultasyon