Sesuaikan Tema WP Anda menjadi Blog Bebas Spam

Listen to article

Trik ini telah dibahas di Wordpress Codex dan forum dukungan, namun saya ingin mengulanginya di sini bagi mereka yang belum berkesempatan mempelajarinya dan masih menderita dari spam komentar, trackback, dan referensi.

Jika Anda menggunakan plugin WP ShortStats, Anda mungkin sudah menyadari bahwa Anda menerima rujukan dari situs yang menargetkan wp-comments-post.php Anda, yang seharusnya tidak terjadi karena itu adalah file internal Wordpress. Ini merupakan indikasi bahwa blog Anda sedang menjadi target spam rujukan atau spam trackback.

Salah satu perbaikan awal yang saya tambahkan di file .htaccess adalah aturan rewrite untuk seharusnya memblokir spam rujukan:

RewriteCond %{HTTP_REFERER} "!^http://www.yugatech.com/blog/.*$" [NC]
RewriteCond %{REQUEST_URI} ".*wp-comments-post.php$"
RewriteRule .* - [F]

Rupanya itu membantu menghentikannya sekitar 90%, yang cukup efektif menurut saya. Namun, masih ada spam trackback yang perlu dipertimbangkan, jadi berikut satu tips yang dapat Anda terapkan di tema WP Anda:

1) Temukan file wp-comments-post.php dan ganti namanya menjadi sesuatu yang lain (misalnya i-get-no-spam.php). File ini dapat ditemukan di folder utama WP Anda.

2) Selanjutnya, cari file comments.php di folder tema aktif Anda dan edit semua kemunculan istilah "wp-comments-post.php" agar sesuai dengan nama yang telah Anda ubah.

Jika Anda menggunakan plugin komentar lain, seperti Paged Comments, mungkin ada sedikit perubahan dalam langkah-langkahnya, tetapi itu adalah gagasan umumnya.

Sudah selesai. Sekarang, bot spam yang telah menandai halaman formulir komentar WordPress Anda akan mendapatkan kesalahan 404 pada kunjungan berikutnya.

Frequently Asked Questions

How can I reduce referral spam on my WordPress blog?
Add a rewrite rule in .htaccess that blocks requests to wp-comments-post.php from unwanted referrers.
What is a simple way to stop trackback spam in WordPress?
Rename wp-comments-post.php to a custom name and update the comment form action in your theme's comments.php accordingly.
Where is the wp-comments-post.php file located?
The file resides in the root WordPress folder of your installation.
React to this article:
Written by
Abe Olandres

Abe Olandres

Editor-in-chief

Abe is the founder and Editor-in-Chief of YugaTech with over 20 years of experience in the technology industry. He is one of the pioneers of blogging in the country and is considered by many as the Father of Tech Blogging in the Philippines.

View all posts by Abe Olandres →

10 Comments

PR
project management · 13 years ago

I always spent my half an hour to read this weblog’s content all the time along with a mug of coffee.

Reply
VA
vanja · 19 years ago

Improves erectile function no side effect medicine

Reply
JA
JackyMool · 20 years ago

Who can help me with .httpaccess ?
where i can fined full information about .httpaccess file syntaxis?

Reply
7K
7KoiL8U5k4 · 20 years ago

Hi! Very nice site! Thanks you very much! mwLJFRdz2PKhXF

Reply
SE
SELaplana · 20 years ago

my blog is actually not using the Akismet Technology to avoid such spam comments. However, I successfully avoid these things by installing the Mathematics comment plugin, which is not capable of controlling spam pings for trackbacks.

Thanks for echoing this topic. this hack willl really help.

Reply
MI
Mita · 20 years ago

great timing…been having problems with that lately. salamat!

Reply
JH
jhay · 20 years ago

I’d like to implement this fix, but I’m afraid I might end up messing up my WP installation, hehehe

Will probably do it on a test blog first. Great how-to by the way.

Reply
PI
pinoywebdev · 20 years ago

wordpress comes with security fixes and are updated every time a new issue arises. even so, every now and then problems do came up.., this discourages me to came up with my own version of php-mysql powered blog.. I am poor when it comes to security consideration — I don’t even know how spammers could destroy my site =(

Reply
AN
AnP · 20 years ago

heaven sent tip! thanks!

Reply
KU
kutitots · 20 years ago

you might need to rename the “comments.php” within the code of the template file too because it’s part of the conditional statement. It’s actually on secode line of the code in comments.php (when you open it up in Notepad).

Reply

Leave a Reply

Loading next article...