sanitize_text_field()
WordPress function that sanitizes a string by removing HTML tags, encoding special characters, and stripping unwanted data.
How it works
WordPress function that sanitizes a string by removing HTML tags, encoding special characters, and stripping unwanted data.
In WordPress
The primary function for sanitizing text input from forms. Always pair with wp_unslash() for superglobal data.
Related terms
WP HealthKit checks for sanitize_text_field()-related vulnerabilities automatically
Run a Free Audit