About

Sanitization means clearing data (often: user input) of unwanted input. This is done to prevent errors or security problems like injection of malicious code into the database. WP offers over a large number of sanitization functions to make data safe for further usage.

Sanitization means clearing unwanted data to ensure it is safe for further processing and usage. For instance, checking if a user name does not contain html, a search string does not contain a SQL injection to drop all database tables or an url does not contain a script that is meant to hack a site.

WP offers over a dozen sanitization functions to check the validity of common user inputs. Keep in mind that not only user input should get sanitized as often data used in a request gets fetched from URl query arguments, GET/POST/etc data or via remote servers (RSS/Atom/Parsing/etc) which must be sanitized before using it as well.

history | excerpt history