Text Limiter is a free extension for the Meta Box plugin which allows you to limit the number of characters or words entered for text and textarea fields.
Using Text Limiter extension, you will have a similar input field like post content where the numbers of words entered and left are shown. It's very useful when you need to restrict the limit of the content entered by users to prevent unexpected result.
The numbers are updated in real-time. If users enter more than the specific words (or characters), the plugin automatically truncates the text to keep the length under the maximum value configured.
Install
You need to install Meta Box plugin first
- Go to Plugins | Add New and search for Meta Box
- Click Install Now button to install the plugin
- After installing, click Activate Plugin to activate the plugin
Install Meta Box Text Limiter extension
- Go to Plugins | Add New and search for Meta Box Text Limiter
- Click Install Now button to install the plugin
- After installing, click Activate Plugin to activate the plugin
Usage
Simply add 'limit' => 40
to text or textarea field parameters to limit by 40 characters.
If you need to limit by words, just add 'limit_type' => 'word'
.
That's all! Note that this extension works only with text and textarea fields.