WordPress.DB.PreparedSQL.NotPrepared

SQL query is not prepared

A database query includes dynamic data without using `$wpdb->prepare()` or an equivalent safe pattern.

critical weight

Why It Shows Up

The scan found a SQL string passed to `$wpdb` where variables appear to be interpolated or concatenated directly.

Why It Matters

Unprepared SQL can allow SQL injection when user-controlled values reach the query.

How to Fix

  • Move dynamic values into placeholders such as `%s`, `%d`, `%f`, or `%i` where supported.
  • Pass the values as separate arguments to `$wpdb->prepare()`.
  • For table names, column names, and sort directions, use strict allowlists instead of raw user input.

Affected Plugins

RankPluginScoreErrorsWarningsInstallsAddedUpdatedTop Issue
#1651Bulk Delete Comments4115615k+Direct Query
#1652Bulk Auto Image Title Attribute (Image Title tag) optimizer (Image SEO)411637900Missing nonce verification
#1653Collapsed Archives415441k+Output is not escaped
#1654Maspik – Multi-Layer Spam Protection41811530k+Missing nonce verification
#1655Custom Post Type Cleanup4170121k+Output is not escaped
#1656Duplicate Post Page Menu & Custom Post Type41351110k+Text Domain Mismatch
#1657Duplicate Page and Post41262170k+Unsafe printing function
#1658SNORDIAN's H5PxAPIkatchu4111988500SQL query is not prepared
#1659Log cleaner for Solid Security4165478k+Text Domain Mismatch
#1660Most Popular Categories41672600Output is not escaped
#1661Omnibus — show the lowest price41353710k+Output is not escaped
#1662Optimus – WordPress Image Optimizer41522030k+Unsafe printing function
#1663Page & Post Notes4112771k+Non-prefixed global variable
#1664Plugin Activation Tracker4136241k+Text Domain Mismatch
#1665Product Expiry for WooCommerce4133892k+Request data is not unslashed
#1666Simple Google Photos Grid414821k+Output is not escaped
#1667Simple Lightbox412148100k+Nonce verification recommended
#1668Simple Revision Control4122421k+Dynamic hook name
#1669SQL Chart Builder413852500Text Domain Mismatch
#1670StifLi Flex MCP – MCP Server with undo for ChatGPT, Claude & Gemini4121161k+Interpolated SQL is not prepared
#1671Feedback Company416336800Output is not escaped
#1672Threat Scan Plugin412917400Output is not escaped
#1673Visibility Logic for Elementor41274330k+Output is not escaped
#1674WC Price History4118244k+Database parameter is not escaped
#1675M-Pesa(Kenya) Checkout for Woocommerce4146381k+Text Domain Mismatch
#1676WP Lorem ipsum413729500Unsafe printing function
#1677WP Media folders4119743k+Direct Query
#1678WP Test Email41322820k+Unsafe printing function
#1679WPC Smart Price Filter for WooCommerce411953600Nonce verification recommended
#1680Contador de Visitas423725500SQL query is not prepared
#1681Custom Admin Page by BestWebSoft – Configurable WordPress Dashboard Pages Plugin42472181400Text Domain Mismatch
#1682Custom Fields for Gutenberg4224241k+Output is not escaped
#1683Link Manager – Analyze, Automate, and Monitor Links4231671k+Direct Query
#1684Delete Expired Transients4249655k+Direct Query
#1685Exclude Pages42311420k+Non Singular String Literal Domain
#1686Geo Blocker – Control Site Access by Region and IP4210641k+Direct Query
#1687Hide Cart Functions4212503k+Nonce verification recommended
#1688LeadSnap4214841k+Input is not validated
#1689Manage User Columns4215271k+Request data is not unslashed
#1690Mass Delete Unused Tags42219800Output is not escaped
#1691Giveaways and Contests by RafflePress – Get More Website Traffic, Email Subscribers, and Social Followers4217150120k+SQL query is not prepared
#1692Republish Old Posts4283242k+Output is not escaped
#1693Sendcloud Shipping4278565k+Output is not escaped
#1694Set All First Images As Featured424413600Text Domain Mismatch
#1695Speed Contact Bar4253204k+Output is not escaped
#1696Transients Manager42455020k+Output is not escaped
#1697Auto Coupons for WooCommerce4282683k+Output is not escaped
#1698Ultimate Gift Cards for WooCommerce42104537k+Non-prefixed global variable
#1699WP Author Security424013400Output is not escaped
#1700WP Fingerprint4234479k+Direct Query