Disable wordpress comments API

We’re using the disqus plugin on our wordpress site, so anyone commenting should have a login through disqus.
Yet, I’m still seeing spammers trying to post through the regular comments API.
They’re not getting through to the post, but they’re clogging my inbox as admin.

How do I disable this API – I only want to accept comments that come from a logged in Disqus user?

Related posts

Leave a Reply

2 comments

  1. There is much easier way to close standard WordPress comments. Just add

    add_filter( 'comments_open', '__return_false' );
    

    to your functions.php file and comments will be closed.

  2. You can try to stop it in the pre_comment_on_post hook

    add_action('pre_comment_on_post', 'no_wp_comments');
    function no_wp_comments() {
            wp_die('No comments');
    }
    

    I use this when I use Facebook comments instead of WordPress comments.

    Here is a similar example with an anonymous function:

    add_action('pre_comment_on_post', create_function( '','wp_die("No comments");'));
    

    but I prefer the first example, it’s easier to modify.

    This hook is in the file wp-comments-post.php as:

    do_action('pre_comment_on_post', $comment_post_ID);