When one of our clients asked that their site’s Contact form have a Max Word limit on a “Comments” textarea / “text area” field, and that Contact Form was using the nice Contact Form 7 WordPress plugin, the quickest way I knew to achieve this was to create a plugin to add a bit of extra functionality to how CF7 handles Text areas. Thanks to WordPress & Contact Form 7’s use of hooks and filters, the plugin simply adds an extra text field in the back end, allowing admins to specify a max word count on any Text area, and then on the front end, adds a simple jQuery script to limit input on that text field to the given number of words.
Like it? Download the plugin to use on your own site. Don’t like it, or have questions or comments or concerns? Please use the WordPress.org support forums.
Update for 2016 : after being dormant for 2 years and a whopping 35 version releases of Contact Form 7 since this was last updated, it is now updated to be compatible with the latest versions of Contact Form 7 and WordPress core, which as of this update are 4.4 and 4.4.2 respectively.
Plugin count not only words but also spaces… (((
maybe there should be a words box and a character box?
And yes, ‘space’ is not a word, it is absolutely crazy to count them.
the “word count” is done by using the JS “split” method to split the text in the textarea apart for each ” ” (space) and chop off after 10 space’d separations
Is it possible to adjust this plugin to count characters instead of words? can you explain it if so ? Thanks in advance.
how can I add an operation (multiplication) so it calculates the wordcount times X (1.5 for example) Don’t know much php but suppose “.$multiplication.” will have to be used.
Paulo – it was a pretty quick hack for me to repurpose the existing “maxlength” field in CF7 for the purpose of max Words. i am not quite sure as of yet how to add another option in there to allow users to specify counting Characters rather than Words.
what you could do though is to just copy the wpcf7wc.js file to your active WP theme, and then in your theme’s functions.php file, do
and use your own version of the script. then you could modify the JS to simply count characters rather than words?
This plugin breaks my form if I am also trying to use Watermark text in the textarea. Any ideas on how to fix that, because I’d love to use this but I’d choose my watermark text over the character count…
Rather than have to count words, count characters?
Thanks for creating this plugin and sharing it with the community. I’m also having the error ‘script appears in the text area box after word count has been reached’. Is there any way I can aid you in troubleshooting this issue, as you cannot replicate it? Or maybe you’ve been able to duplicate the issue since your previous reply?
Works like a champ! Thanks so much…
Just what i have been looking for.
since the last contact form 7 update, this plugin is causing my whole WP installation to stop working, I disabled this plugin,and everything is working again.
thanks for the heads up, Joey. i will check it out with the latest versions of WP + CF7 & get this fixed up asap
Seems to work flawlessly for me! Excellent! Wish I could limit to characters as another option! Thanks!
Does this plugin work with the latest wordpress version?
Just wanted to say that something was again changed in the recent version of Contact Form 7. Updated, and my whole site was down with a 500 error. Renamed this plugin’s folder and brought it back up.
Now, i’m off to find an older version of Contact form 7…
this little plugin ” Contact Form 7 Textarea Wordcount” is so great (better it was…..)
Can I (we) hope for an update to use it in CF 3.3.3??????????????????????????????????????
The Wordcount plugin stopped working after the latest update of Contact Form 7. Just a reminder 😉
Thanks for all the great feedback, all. We will be working to update the CF7 Textarea Wordcount plugin for the latest versions of Contact Form 7, over the next couple weeks.
I’ve reverted to Contact Form 7 ver 3.4.2
Nudging you that this plugin needs to be updated to current version of CF7 as it otherwise crashes WordPress! Yikes!! Been months! Have a heart! (gentle reminder, and THANKS!!)
You have a update pay for this plugins
Hello all! This plugin has now been updated for Contact Form 7 v4.4 – please update or download the new version from https://wordpress.org/plugins/contact-form-7-textarea-wordcount/ . Any future comments should be posted under WordPress.org support forms https://wordpress.org/support/plugin/contact-form-7 as we are now closing comments on this old blog post here. Thank you!!