One way that you can limit the length of input tags used by those visiting your WordPress-powered website is to use the "maxlength" property built into the HTML "input" tag. Attributing a maximum value to this tag automatically cuts off any input at the specified length. The easiest way to make this change is by using the built-in WordPress editor. When editing your WordPress site files, it's always a good idea to make a backup before starting, so you have a copy of your original file in case anything goes wrong.

Log in to your WordPress website with the administrator username and password.

Click the "Appearance" link on the Dashboard. Select "Editor" from the submenu.

Select the theme containing the page you wish to edit from the drop-down box.

Locate the page you wish to edit in the list of theme pages. Click on the page to open it inside the editor.

Copy all the text inside the editor. Paste it into a plain text document and save it somewhere on your computer. This will give you a backup in case something goes wrong.

Look through the code for the <input> line. For example in the Prologue theme, the following line appears in the file "post-form.php." <input type="text" name="tags" id="tags" autocomplete="off" />

Insert the "maxlength" property into the input tag to limit the length allowed. For example, to limit the length to 20 characters in the Prologue theme example, enter the following code: maxlength="20" So the entire line should look like this: <input type="text" name="tags" id="tags" maxlength="20" autocomplete="off" />

About the Author

Nathan McGinty started writing in 1995. He has a Bachelor of Science in communications from the University of Texas at Austin and a Master of Arts in international journalism from City University, London. He has worked in the technology industry for more than 20 years, in positions ranging from tech support to marketing.