Tips & Tutorial

How To Disable Native WordPress Comment If You’re Using Disqus?

Oleh takien

I have been using Disqus since years ago to replace default comment system on this WordPress blog. Previously I was using Disqus Comment System plugin (https://wordpress.org/plugins/disqus-comment-system/) , the official Disqus plugin for WordPress.  But now I’m using Disqus Conditional Load, the unofficial Disqus plugin, because it’s promised to be faster than the official one. The only problem is, although you have enabled Disqus on your blog, the spammer still can insert comment directly. I think, this should be disabled.

So, how to disable WordPress comment? There’s a filter named preprocess_comment in WordPress. This filter located inside wp_new_comment() function in wp-includes/comment.php. No, you no need to go there. Just add this one line code on your functions.php of your theme.

add_filter('preprocess_comment','__return_false');

Wanna spam? Please fight with Disqus. 🙂

Tulisan ini sudah berumur: 10 tahun 6 bulan 6 hari. Informasi di dalamnya mungkin sudah tidak relevan, tapi nilai historisnya sangat berharga, terutama bagi saya sebagai penulisnya.

Tag Terkait: