Limiting The Amount Of Text In Comments

Eric Teubert over at WPEngineer has shared some Javascipt code that can be used to limit the amount of text that users can place within the comments field or any text field for that matter. Could be used to combat those comment spammers that like to post a bazillion words but the negative side is that lengthy, legitimate commentators will need to be cut short.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let's discuss your ideas.


  1. Yeah, not a fan of doing this. I’d rather use a captcha or just stick with Akismet, to combat spam.

    Akismet does a dang good job, in my opinion.


  2. Those long comments with all the links are posted by spam scripts and won’t be affected by any javascript in the comment form.


  3. JavaScript won’t have any effect on spam. Bots generally don’t process JavaScript. That’s why captcha’s which make use of JavaScript are very effective at blocking bots.


Comments are closed.