Comment Gatekeeper Developer Doc

Here are the filters used in the plugin that give you or your developer power to customize the plugin to your liking.

apply_filters( ‘lb3cgk_gatekeeper_default’ , “What is your quest” );
apply_filters( ‘lb3cgk_gatelock_default’ , “to seek the holy grail” );
The plugin has a default question and answer in case the site owner does not add their own.  With these two filters, you are able to set the default question and answer for them.

apply_filters( ‘lb3cgk_add_gatekeeper_filter’ , $result , $post_id )
This filter defaults to $result = TRUE and adds the gatekeeper to every post.  The filter passes the result and the post id to your filter so that you decide which posts get the gatekeeper and which do not.

apply_filters(‘lb3cgk_return_gatekeeper_and_gatelock_filter’ , $gate_array, $post_id );
This filter passes an associative array of the “gatekeeper” question and the “gatelock” correct answer along with the post id.  This array is used in two places: to disply the question on the comment form and then to compare the $_POST input against the correct answer.  With this filter, you can modify the question and answer post-by-post.

Comment Gatekeeper Quick Start Guide

These instructions will help you block comment spam from your WordPress site with the Comment Gatekeeper plugin.

From your Dashboard:

  1. Go to the Settings Menu > Discussion
  2. Scroll to the section “Comment Gatekeeper Settings”
  3. Enter your question and answer
  4. Save your settings

A simple example question is “What is 1 plus 3” and you all know that the answer is 4.  By entering a question like this, automated spam commenters will be prevented from commenting since they aren’t able to read the question in proper context.

Believe it or not, that’s all there is to it.  Your comment forms will now have the gatekeeper ensuring that only those who answer the question correctly will be able to comment.

One thing to NOTE: this plugin requires that your theme uses the comment_form() function.  If you install and activate this plugin and don’t see the field appearing on your comment form, your theme may not be using this WordPress function.  It can be added by editing your theme so if you are uncomfortable doing this on your own, please ask your website developer to contact me for guidance.

Spanish Translation Instructions

The Comment Gatekeeper is now available in Spanish.  The translation is automatically sent when you download the plugin so all you need to do is activate it.  To do this, you will need to edit your “wp-config.php” file. If these steps are beyond your technical skills, you can ask your web developer to help. If you don’t have a web developer, use the contact form at the bottom of this page to contact me for a cost estimate.

You will find a line that says:

define('WPLANG', '');

Edit this line to add Spanish:

define('WPLANG', 'es_ES');

Save the file and all the Comment Gatekeeper instructions will be in Spanish. If you have downloaded the Spanish translations for WordPress, then your entire dashboard will now be in Spanish as well.

If you need help, please use the contact form here:

Comment Gatekeeper Plugin Approaching Release

The comment gatekeeper is a lightweight plugin that adds a simple question and answer to your comment form.  The comment form displays the question and the commenter types in their answer as part of the comment form.  If the commenter answers incorrectly, then their comment fails and doesn’t get added.

The primary use of this plugin is to reduce comment spam but it can also be used to make your comments “by invitation only.”  To do this, you can create a question like, “Please enter the invitation code” and then email your invitees the code.  In this way, only those who have the invitation will be able to enter the code and comment.

I’m looking forward to releasing the plugin and also hearing feedback from people about its operation.  If you are interested in trying out a pre-release version of the plugin, just leave me a comment here and I’ll follow up with you.