---
title: "Password"
description: "Add Password control to your custom blocks for WordPress using the Lazy Blocks plugin."
url: "https://www.lazyblocks.com/docs/blocks-controls/password/"
lastUpdated: 2026-09-09
source: "blocks-controls/password.mdx"
---
# Password

Password control provides a masked input field for entering sensitive text. The control uses the standard HTML password input type.

This control only masks the input in the editor using `<input type="password" />`. It does not encrypt or provide additional security for the stored value.

## Control Settings

- **Placeholder** (`placeholder`) - text shown when no value is entered. Empty by default
- **Characters Limit** (`characters_limit`) - the `maxlength` put on the input, from 0 to 524288. Empty by default, which is no limit

## Usage

```php title="PHP" /$attributes['control_name']/
<div>
  <?php echo esc_html( $attributes['control_name'] ); ?>
</div>
```

```hbs title="Handlebars" /{{control_name}}/
<div>
  {{control_name}}
</div>
```

```php title="Post Meta" /get_lzb_meta( 'control_meta_name' )/
<div>
  <?php echo esc_html( get_lzb_meta( 'control_meta_name' ) ); ?>
</div>
```

Consider using WordPress core functions like `wp_hash_password()` if you need to store passwords securely.

## Documentation Index
> Fetch the complete documentation index at: https://www.lazyblocks.com/llms.txt
> Fetch every page in a single file at: https://www.lazyblocks.com/llms-full.txt
