How to Turn off HTML Form Field Autocomplete

1 minute read

To turn off the browser autocomplete for HTML form fields you use the command autocomplete=yes. If the field is an email field like:

<input type="email" name="_email" autocomplete="email" />

You can use the autocomplete="email" too.

Now that is easy, right?
However, the autocomplete command is only a signal to the browsers to act on and is not guaranteed. Sometimes they just ignore the command and fill in the field with the value of the previous field.

Don't fear I have a solution for you!
By adding an additional hidden field it will clear the previous field's value and keep your input field empty. here is the code:

<input type="text" name="JumpingGiraffeLovesYou" style="display:none;" />
<input type="email" name="_email" autocomplete="email" />

This should do the trick!
If you are interested in our Free and Premium plugins have a little look at our WordPress & WooCommerce Plugin page.

Spread the word on the social medias and help the community.