Letöltés: Forget Spam Comment Plugin
Ez egy ingyenes spamellenes plugin kizårólag a WordPress alapértelmezett hozzåszólåsi rendszeréhez.
Hogyan mƱködik
AlternatĂvakĂ©nt, haladĂł felhasznĂĄlĂłk szĂĄmĂĄra az alĂĄbbiakban a kĂ©zi mĂłdszer lĂĄthatĂł
A WordPress alapĂ©rtelmezett hozzĂĄszĂłlĂĄsi rendszerĂ©nek kĂ©t fĆ problĂ©mĂĄja van.
- Spam hozzĂĄszĂłlĂĄsok vonzĂĄsa.
- Nem kĂŒldött nyomon követĂ©si e-mailt a megjegyzĂ©s szerzĆjĂ©nek (Egy idĆ mĂșlva megbeszĂ©ljĂŒk).
BeszĂ©ljĂŒnk a megoldĂĄsokrĂłl.
Spam hozzĂĄszĂłlĂĄsok megelĆzĂ©se
Ahelyett, hogy közvetlenĂŒl lehetĆvĂ© tennĂ©nk bĂĄrki szĂĄmĂĄra, hogy POST kĂ©rĂ©st tegyen a /wp-comments-post.php
cĂmen, hozzĂĄadhatunk nĂ©hĂĄny logikĂĄt, hogy 100%-ban megakadĂĄlyozzuk a spam kommenteket.
1. lĂ©pĂ©s. A Comment POST-kĂ©relem ĂștvonalĂĄnak korlĂĄtozĂĄsa a lekĂ©rdezĂ©si paramĂ©terek segĂtsĂ©gĂ©vel
HĂĄrom mĂłdszert fogok megosztani, hasznĂĄlj egy mĂłdszert.
Apache
- Yoast > Go to Tools > File Editor
- RankMath > Menjen az ĂltalĂĄnos beĂĄllĂtĂĄsokhoz > Edit .htaccess
- FTP/SSH > EllenĆrizze a /var/www/html
# Ha a lekérdezési karakterlånc nem felel meg, 404 visszatérés
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post\.php
# You may change 45jpfAY9RcNeFP to something else
RewriteCond %{QUERY_STRING} !^45jpfAY9RcNeFP
RewriteRule (.*) - [R=404,L]
</IfModule>
Ha LiteSpeedet hasznĂĄlsz, az is tĂĄmogatja a .htaccess fĂĄjlt. A vĂ©grehajtĂĄs utĂĄn Ășjra kell indĂtania.
NGINX
location = /wp-comments-post.php {
if ($query_string !~ "45jpfAY9RcNeFP") {
return 404;
}
}
Cloudflare

- Bejelentkezés a Cloudflare Dashboardra
- VĂĄlassza a TƱzfal > TƱzfalszabĂĄlyok menĂŒpontot
- Hozzon lĂ©tre egy Ășj tƱzfalszabĂĄlyt az alĂĄbbi kifejezĂ©ssel
Field | Operator | Value | |
URI | contains | wp-comments-post.php | And |
URL Query String | does not equal | 45jpfAY9RcNeFP |
- Choose Action: Block
A végén låtni fogja a kifejezést
(http.request.uri contains "wp-comments-post.php" and http.request.uri.query ne "45jpfAY9RcNeFP")
lĂ©pĂ©s. A Comment POST URL javĂtĂĄsa a Scroll esemĂ©nyen
- Adja hozzå az alåbbi funkciót a Code Snippets plugin vagy a téma functions.php hasznålatåval
- GyĆzĆdjön meg rĂłla, hogy a megfelelĆ domain Ă©s Ʊrlap azonosĂtĂłt hasznĂĄlja.
function correct_comment_url_on_scroll() {
// Check if Comment is enabled
if(comments_open()) echo '<script>
let commentForm = document.querySelector("#commentform, #ast-commentform, #ht-commentform");
// Load new comment path on the scroll event
document.onscroll = function () {
commentForm.action = "https://www.example.com/wp-comments-post.php?45jpfAY9RcNeFP";
};
</script>';
}
add_action('wp_footer', 'correct_comment_url_on_scroll', 99);
AlternatĂvakĂ©nt, ha a GeneratePress Premium tĂ©ma felhasznĂĄlĂłja vagy, akkor a fenti JS rĂ©szt közvetlenĂŒl az Elements modul segĂtsĂ©gĂ©vel adhatod hozzĂĄ.
<script>
let commentForm = document.querySelector("#commentform");
commentForm.action = "https://www.example.com/wp-comments-post.php";
// Load new comment path on the scroll event
document.onscroll = function () {
commentForm.action = "https://www.example.com/wp-comments-post.php?45jpfAY9RcNeFP";
};
</script>
- Add a new hook
- New Hook Title: Komment URL megvåltoztatåsa menet közben
- Hook: WP Footer
- Priority: 99
- Location: Posts – All posts
- Publish
Hogyan ellenĆrizhetĆ, hogy mƱködik-e?
- ĂltalĂĄban a WordPress 405-ös vĂĄlaszt ad vissza a GET kĂ©rĂ©sre a /wp-comments-post.php oldalon.
- A fenti beĂĄllĂtĂĄsok utĂĄn azonban Access Denied (HozzĂĄfĂ©rĂ©s megtagadva) jelenik meg.
- Ăs az URL csak akkor töltĆdik be, ha jelen van a 45jpfAY9RcNeFP speciĂĄlis lekĂ©rdezĂ©si karakterlĂĄnc, amelyet a spam-kommentek megelĆzĂ©se Ă©rdekĂ©ben adtunk hozzĂĄ. Ezt a lekĂ©rdezĂ©si karakterlĂĄncot megvĂĄltoztathatja valami mĂĄsra a fenti konfigurĂĄciĂłban.
- A forrĂĄskĂłd ĂĄltalĂĄban mutatja wp-comments-post.php Ăștvonal, de ha megvizsgĂĄlja elem utĂĄn görgetĂ©s akkor Ă©szre fogja venni egy lekĂ©rdezĂ©si karakterlĂĄnc hozzĂĄadva.
Eredmény #1: Nincs spam

Eredmény #2: Spammerek blokkolåsa

Bónusz tipp, hogy az alapértelmezett Comment System még jobb legyen
- AlapĂ©rtelmezĂ©s szerint a WordPress hozzĂĄszĂłlĂĄsi rendszere nem kĂŒld utĂłlagos e-mailt a hozzĂĄszĂłlĂĄs szerzĆjĂ©nek. Ennek a problĂ©mĂĄnak a megoldĂĄsĂĄhoz hasznĂĄlhatja az Arno Welzel ĂĄltal kĂ©szĂtett Comment Reply Email Notification plugint.
Ha tetszik ez az informĂĄciĂł, kĂ©rjĂŒk, adja tovĂĄbb barĂĄtainak. đ
Thank you so much Sir Gulshan Kumar! I really appreciate your guide, and this has saved me tons of headache. Implemented via Cloudflare WAF plus Generatepress Elements Module.
Glad to hear. Thank you!
By the way, how do you know if legit users won’t get blocked? Before this, I’ve been using a CF firewall rules that will blocks or challenge anyone who visit wp-comments-post.php but actually by doing so, legit users also got blocked. How this one different? Is it because of the string „45jpfAY9RcNeFP” that will differentiate which request is from bot and which request is from legit users? If legit users, they should’ve the string, if it’s spam, they don’t have that string. Am I understand it correctly?
You need to implement exactly as per instructions to prevent users from blocking.
Does this plugin / method will stop website from having spam comments once and for all or do we still receive it but it’s automatically filtered from the real comments (like Akismet)?
There is no filter. It just stops spam.
That is so cool! Will try it. Thank youuuuuuuuuuuuuu
You’re welcome!
The best plugin to filter the spam.
Hi Gulshan.
I just wanted to let you know that I’ve been using your plugin for a few weeks now and it is brilliant. Genuine comments still get through but all of the spam, and I mean ALL of it, is filtered out. Excellent job!
Well done and thank you so much for sharing it for free so that hobby bloggers like me can make use of it.
thank you very useful
Hy! I just installed your plugin but Google Console show me tons of errors:
https://prnt.sc/wnhkbd
How can I solve this? Thanks!!
Hi,
I am also using plugin at this blog. It works perfectly fine here.
If you want to me look into this issue, please provide your actual site URL where I can see live.
Thanks!
Brilliant! Thank you so much!
I have question
Where can I get value code like 45jpfAY9RcNeFP
You can use MD5 generator or write any random text. I’d recommend using plugin for set and forget experience.
Good plugins for stopping spam.
I have use this plugin earlier. It is working perfectly.
Wow! This is great. Thanks a lot. Gonna give a try to this trick.
Glad, this is not a spam comment. Just kidding!
Thanks Huzaifa!đ