I’m completely new to wordpress plugin development. I want to write a plugin to delete comments I don’t want based on a keyword list.

Update: WordPress already comes with this feature under Comment Moderation

The code

The code isn’t complex. It first use the preprocess_comment hook to check the comment content. If it contains hyperlinks, a 404 error will be returned and the comment will not be inserted into database.

Thanks to who kept spamming my site and helped improved my code.

One Thought to “Writing a wordpress plugin to filter comments”

  1. I want to to thank you for this wonderful read!! I certainly loved every little bit of it.
    I’ve got you saved as a favorite to look at new stuff you post…

Leave a Comment