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 146.185.223.125 who kept spamming my site and helped improved my code.

2 Thoughts to “Writing a wordpress plugin to filter comments”

  1. I’m really enjoying the theme/design of your
    blog. Do you ever run into any browser compatibility
    issues? A couple of my blog visitors have complained about my blog
    not working correctly in Explorer but looks great in Firefox.
    Do you have any suggestions to help fix this issue?

  2. 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