SQL Injection Prevention

Use when writing any custom database query in WordPress with $wpdb — get_results, get_var, get_row, query, or building WHERE/IN/LIKE/ORDER BY clauses. Uses $wpdb->prepare() with correct placeholders (%d, %s, %f, %i), $wpdb->esc_like() for LIKE, and allowlists for identifiers that cannot be parameterized. Prevents SQL injection. Apply proactively to every query containing a dynamic value.

wpultimatesecurity Updated 56 repo stars

File contents

wpultimatesecurity/WordPress-Security-Skills commit 65cfbddc03

Frequently asked questions

npx get-skill add wpultimatesecurity/sql-injection-prevention