Resumo de IA
Would you like to limit the number of words or characters that a user can enter into certain fields in your form? Long entries can be hard to review and sometimes may not fit your goals for a form.
This tutorial will show you how to easily restrict the length of Single Line Text and Paragraph Text fields.
Antes de começar, você precisará garantir que o WPForms esteja instalado e ativado em seu site WordPress e que você tenha verificado sua licença. Em seguida, você pode criar um novo formulário ou editar um existente para acessar o construtor de formulários.
Adding a Character or Word Limit
Once your form builder is open, be sure to add either a Single Line Text or Paragraph Text field. For this example, we’ll add a Paragraph Text field.

Now, click on this field in the preview area to open its Field Options.

Within the Field Options panel, click on the Advanced tab to open the field’s advanced options.

Then, to limit the number of characters or words, select the Limit Length option.

When you enable this option, two additional fields will display:
- Number Input: Enter a numeric value to use as the maximum limit.
- Characters and Words Dropdown: Choose whether you’d like to limit by the number of individual characters or words.
Note: If you’ve chosen to limit the length by Characters, keep in mind that spaces, periods, commas, etc. all count toward the total character limit.
For our example, we’ll limit our field to 100 characters.

After setting up these options how you’d like, be sure to save your form.
Note: To prevent users from entering special characters in Single Line Text and Paragraph Text fields, you can apply certain restrictions using a PHP snippet. For instructions on how to set this up, see our developer documentation.
Testando Seu Formulário
For the last step in this setup, we recommend testing your form so you can check that it looks and works how you’d like. Our detailed guide on testing forms shares a checklist of recommended steps to consider before publishing your forms.
For this particular feature, the main thing you should notice when testing your form is the text showing how many words or characters are allowed, and how many have been used.

Once the limit is reached, the user will not be able to enter any additional characters in this field.
Note: For advanced field customization, consider using custom input masks to define and restrict the format of the entry. Learn how to implement this in our guide on using custom input masks in WPForms.
Perguntas Frequentes
Below, we’ve answered some of the most common questions we receive regarding limiting words or characters.
Can I set a minimum number of characters for text input on my forms?
Yes, you can enforce a minimum character count for Single Line Text, Paragraph Text, and Password fields. For detailed instructions on setting a minimum character limit, please refer to our developer documentation.
Observação: Esteja ciente de que isso requer funcionalidades avançadas, como adicionar código ao seu site, e, portanto, é recomendado para desenvolvedores.
That’s it! You can now limit the number of words or characters that a user can enter into your Single Line Text and Paragraph Text fields.
Next, would you like to customize your form’s automatic notification emails? Notification emails can easily include a header logo, custom background color, and custom content. Be sure to check out our tutorial on setting up notification emails for all the details.