skip to Main Content

In wp-admin, the admin can set a list of terms in Settings > Discussion that can be used to block spam comments.

This list is also used by other plugins, such as Contact Form 7, to help prevent contact form spam.

I’d like to know how to access this Disallowed Comment Keys list programmatically so I can utilise it in my own plugin?

2

Answers


  1. Chosen as BEST ANSWER
    $disallowed_keys = get_option( 'disallowed_keys' );
    $disallowed_keys_array = explode( "n", $disallowed_keys );
    

  2. In my experience, we cannot use default discussion setting on wordpress. I just want to suggest to use this plugin anyway. Thanks.

    https://wordpress.org/plugins/turn-off-comments/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search