### [How to Add a Password Visibility Toggle Button](https://wpforms.com/developers/how-to-add-a-password-visibility-toggle-button/)

**Published:** June 10, 2022
**Author:** Umair Majeed

**Excerpt:** This tutorial will show you how you can provide your visitors with a toggle switch for your forms to allow them to see the password they are typing into the Password form field. 

**Content:**

## Introduction

Would you like to give your visitors the option to show or hide their password as they type it into your form? By default, the Password field in WPForms masks the input with asterisks for security.

WPForms includes a built-in setting that lets you add a password visibility toggle with just one click in the builder. If you’d prefer to add this feature with code for more control, this tutorial will also show you how to do it with a snippet.

## Built-in Option for Password Visibility

Starting with WPForms version 1.9.8, you can enable a built-in option that lets users toggle password visibility, no custom code required.

To enable this feature, click on the **Password** field in the form builder to open its Field Options panel. Then, under the **General** tab, toggle on the **Enable Password Visibility** setting.

![](https://wpforms.com/wp-content/uploads/2024/02/enable-password-visibility-1024x732.png)This is the quickest and easiest way to add a password visibility toggle to your forms.

If you’d prefer more control or want to customize the behavior and styling, you can still follow the tutorial below to add this functionality with a code snippet.

## Adding the Snippet

To manually add a password visibility toggle, you’ll need to place a small code snippet on your site. This method gives you more flexibility to adjust how the toggle looks and works.

Copy the snippet below to your site.

**Note**: Before adding this code snippet, make sure you’ve installed the Font Awesome plugin.

If you need any assistance in how and where to add custom code snippets, [please review this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
 * Provide a password visibility toggle switch
 *
 * @link https://wpforms.com/developers/how-to-add-a-password-visibility-toggle-button/
 */
  
function wpf_dev_password_toggle() {
    ?>

**Categories:** Tutorials

**Tags:** CSS, Javascript, JS, PHP

---

