No, wpdb::delete
does not handle anything other than WHERE field = X
. You can just use the query
method instead:
$ids = implode( ',', array_map( 'absint', $ids ) );
$wpdb->query( "DELETE FROM table_name WHERE ID IN($ids)" );
Related Posts:
- How to return number of found rows from SELECT query
- Update results, Before deleting the related category [closed]
- I can’t update my data through $wpdb
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- Using wpdb to connect to a different database is not working
- MySQL database migration to WordPress
- Putting form result in my database
- Can i use php sql functions instead of $wpdb?
- Check if post of title already exists
- Does WordPress cache get_user_meta() results?
- How to Join two tables from separate databases within WordPress
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- How to merge local and live databases?
- Import 10,000 Users into WordPress WITH a specific ID for each user
- WPDB: how to get the value of a field in a custom database table
- WP database error for comments_popup_link()
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- No wp-config.php file on local install of wordpress – site still displays
- WordPress get pagination on wpdb get_results
- Different database query in function.php using mysqli
- Converting MYSQL to WordPress $WPDB
- Why is variable not working on custom sql query using wpdb?
- Show MySQL errors that occur when I excute $wpdb->insert()
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Can’t get wp_insert_post to work
- Trying to establish connection to External Database
- Create WP_Query to search for posts by their categories or their parent/child categories
- WSoD being caused by this piece of code
- WordPress not reflecting changed of the database
- $wpdb->update with multiple parameters gives error
- How can I save unique user data on my site? [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- wp query foreach deleting record returning only first or last item
- database sent to a JSON file
- inserting a post from an extern php file but post content doesn’t show on wp site
- Database query works fine outside WordPress
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- $wpdb->insert() does not Insert record in a table
- Using custom tables for old posts
- Help with a $wpdb MySQL Query
- How to retrieve the data from the sever and displaying it in a page?
- $wpdb returns duplicate posts
- Mixing variables into an array when inserting values
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- How can I add a new row in a separate database when someone registers via WordPress?
- Basic wpdb update question
- wpdb Cannot Update column in Database
- Output: “Array”
- How to use mysql LIKE with wpdb?
- Delete database record using plugin from admin panel
- Wpdb get->results to out the the month from the db
- How do I prepare strings for insertions as values into a MySQL table?
- How to use AJAX in WordPress in MYSQL query?
- WPDB – Read and write value from / to database
- form $_post action value gets truncated after it passes through two forms
- WPDB secure custom form
- Adding data to custom wordpress database table
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- populate select options from extra mysql table data
- Query the links Database
- SQL error with custom query
- MySQL Query Returns Array () In Shortcode
- Add posts to custom table in database instead of wp_posts
- Passing in MySQL prepare statement parameter separately throwing error
- Convert a column of a table containing an Array as response in HTML
- Database SQL query error
- Please help! I have a problem with getting wordpress databas
- Error establishing a database connection (Set-up locally)
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?
- Conditional formatting on data fetched from MYSQL
- What is the correct way to search 3 custom fields only in WordPress?
- How to grab data from input and store it into custom table in database?
- Advanced WordPress SQL Query
- can’t delete a row from post_meta table
- MySQL query in WordPress with AJAX
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- How to set max users to 17.000
- Passed variable gets undefined variable error on insert on next page
- MySQL queries in WordPress
- How to fetch results from database
- How to connect database table to each registered wordpress user.
- Using the same shortcode to show any table from the database
- Querying multiple meta_keys in WordPress SQL query
- Let users register weight each day and save it in DB
- Fetching wpdb data from a php file seems to break?
- How to pass username into form that sends data to database
- Insert into db with foreach problem
- Execute multiple PHP Snippets causes error?
- Error resetting database index using ALTER TABLE in $wpdb->query
- Can’t insert into a database wordpress