Skip to main content
WP HealthKit

esc_attr()

WordPress function that escapes a string for safe use inside HTML attributes.

How it works

WordPress function that escapes a string for safe use inside HTML attributes.

In WordPress

Always use esc_attr() when outputting variables inside attributes like class, id, value, title.

Related terms

WP HealthKit checks for esc_attr()-related vulnerabilities automatically

Run a Free Audit
What Is esc_attr()? — WordPress Security Glossary | WP HealthKit