Its not that $wpdb->query does not need $wpdb->prepare(), it’s because of not using $wpdb->prepare() in a correct manner. In your case $wpdb->prepare() never received any values which it must.
Please refer to the Codex for details about using $wpdb->prepare().
Related Posts:
- How does WordPress handle MySQL row lock errors?
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- Help With MySQL to WPDB Query Conversion
- Creating mySQL procedure with $wpdb
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- How to export post 2 posts WordPress plugin data [closed]
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin
- Plugin: register_deactivation_hook works perfectly well, while register_activation_hook suddenly stopped working
- Insert data from .sql file in wordpress plugin
- WP All Import – Execute Imports
- WordPress Backend HA (Automatic failover)
- DB Query not working in Plugin
- Way to send multiple values for column to MySQL?
- WordPress plugin: efficient way to store large data
- Can’t create tables with my plugin
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- How to get the custom field value using SQL query
- Need to know if my approach to designing a geneaology plug-in for wordpress makes sense
- I created a plugin with ‘view page’ that uses MYSQL + PHP. When I use wp_insert_post(), it turns everything to HTML
- best way to upload a large file to wordpress using wp all import
- WordPress UPDATE queries on MySQL database stuck
- Resetting AUTO_INCREMENT primary key
- Re-writing MySQl query for execute faster
- Create Database Tables on Plugin Activation hook
- Linking Plugin Files to WP
- how to search through plugin in wordpress cimy-user-extra-fields?
- Get all the related data from WordPress DB
- How to display blog posts only authored by the administrator
- How can I delete the options from DB when the plugin is deleted?
- WP_Query does not return the result even if the data is present in the database
- How to prevent WP All Export from wrapping XML nodes in CDATA? [closed]
- What’s the preferred method of writing AJAX-enabled plugins?
- Redesigning Custom Post Type “Add New” page
- Notify Admins about Plugin Merge
- Is there any record of installed plugins in the database?
- Using require_once in a Plugin?
- How to call “page specific menu items” in template [closed]
- Adding Featured Image in Post List
- Why does including a file in theme’s functions.php not work?
- WooCommerce – Call to undefined function is_woocommerce()
- Custom headers for the WordPress plugin directory
- plugin wants to update to wrong plugin
- OEmbed from Pinterest
- How can I add a custom header to a custom template in a plugin without using the theme folders
- Trying to avoid including wp-load.php
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Understanding apply_filters
- Custom values are not translated
- Make the plugin directory recognize new version numbers
- Master menu item for multiple plugins?
- Add Top-Level Menu that opens URL
- Change the name of an installed plugin
- Where do I add a new table’s name in wpdb?
- Issue with post request to admin-post.php
- How to create popup same as wordpress popup feature
- action-scheduler vs wp-background-processing
- How to customize user search
- Upgrade Private Plugin without Deleting
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- How to make first_name and last_name required fields in user profile?
- Making my plugin translation ready. Poedit not working
- like to keep reading plugin
- Check if email address exists front end with AJAX in a plugin
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- Global matrix for shortcodes/content for every page
- How to add class in plugin only for network site?
- Plugin Development sqlite or WordPress’ database
- How to write a plugin to add users to a mail list
- WordPress plugin for activating other plugins
- Can we use a webservice with WordPress?
- WooCommerce get_price returning wrong price when used via ajax
- Open Post Thumbnail in New Child Theme File in WordPress
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- New User Form – Custom Menu Page
- Checking instances of scripts in wp_head
- AJAX search posts and pages
- Combine scripts from all extensions of the plugin when an extension is activated
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- How can I prevent my plugin go development trunk [closed]
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Best place for if/else piece of code related to custom plugin?
- How do you assign a UUID to posts/products/comments/reviews?
- How to make a implement queue for scheduling tasks in WordPress?
- Checkbox conflict in my custom plugin admin page
- how to do login using woocommerce rest api From android
- How to create a code editor for my plugin .?
- How to create a custom shortcode based on the layout?
- Manually set a custom admin sub-menu selected?
- wp-pagenavi getting 404 page not found
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- Custom URL image is not zooming
- The Admin page isn’t showing in the sidebar of the dashboard
- Display file contents within Plugin
- When to store store plugin options as a single database record?
- WordPress hack code issue, help required
- WordPress Global Var in Plugin but Outside Function
- Call to undefined function create_function() – PHP 8.2