Look at the documentation, $wpdb->delete() takes at least two parameters, the table name and the Where-conditions as an array(). LIKE isn’t supported for delete imho, so you’ll need to use ->query
global $wpdb;
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key LIKE '_cb_%'" );
$wpdb->query( "DELETE FROM $wpdb->posts WHERE post_type LIKE 'webcam'" );
I assume the double closing parentheses and missing quotes were just from copy pasting?
Related Posts:
- How can I free up the memory used by update_post_meta?
- Insert, update or remove data from database (usermeta)
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Should I use wpdb prepare?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- Best way to abort plugin in case of insufficient PHP version?
- What do you think about custom designed plugin/theme options UIs?
- Where to put third party PHP library?
- Optimize shortcode callbacks
- How to integrate a PHP webmail script into the backend of WordPress?
- Getting wrong relationship value in $args in wp_Query?
- How to log plugin errors to plugin error_log file
- Which to use to execute code during the saving of a plugin settings page?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- How is the data stored in the database?
- Custom theme sufficient or custom plugin neccessary for this feature set?
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- How to create custom home page via plugin?
- Adding callback function for wp_ajax_ has no effect
- Sessions not creating correctly in custom function
- Featured Image not showing in admin
- Is there a way to list tags order by post_meta field
- Activation hook not creating table
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- How to edit mySQL wp_posts table from plugin php?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Ordering posts by metadata
- Get the password key when using the wp_new_user_notification_email filter
- query users by role
- Order properties should not be accessed directly
- How to deal with equal & similar arguments for a function?
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- Disable The Events Calendar plugin from loading its scripts
- Where to store the name of a custom table?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- Maximum lifetime for nonce
- Clearing caches on plugin uninstall
- Custom Taxonomy to dropdown box on adminside wordpress
- Saving value of a selection option in comment form as comment meta
- How to modify the comments to be displayed in a post?
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- Incorporate small angular feature in my wordpress site
- Run Shortcode of post’s custom field in functions.php / Plugin
- mysql_real_escape_string() vs. esc_sql() in WordPress
- How to modify files inside wp-includes directory in wordpress
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- $wpdb->prepare with LIKE and sprintf
- Show message from backend
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Create Widget or Enable Shortcodes in Sidebar
- WP nonce field checkbox prints checked=’checked’ outside input field
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- how to save wp_editor html content in options table
- Auto-complete or auto-suggest from stored data in database
- Get audio metadata on file upload
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- Brainstorm – Slow Query from Plugin Need to Speed It Up
- How to remove/replace current page template?
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- Integrating Custom Database with WordPress
- Is there a way to add a link with add_post_meta?
- Adjust query on single
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- How to determine which capability to use?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- Condition to check previous next article post title
- Quick Draft widget (dashboard.php) using custom post_type
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- Unexpected issue when using attachment_fields_to_edit filter
- Determine if the current page, is being edited
- external Integration with wordpress timeout error
- Organising and completing posts (mark as read and hide)
- Making adding info to an overlay bio easy for average user?
- pull data from wordpress database
- Implementing Select2 plugin into WordPress
- sql query not working in wp plugin
- $wpdb Mysql trigger problem
- Custom MySQL query to pull out Advanced Custom Fields?
- Associating special meaning with user id 0
- Can I access WordPress API’s from within plugin scripts?
- Theming Custom Plugin Page
- Include add_post_meta in a plugin
- Link to a admin submenu item using a custom link
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Change the search results header from plugin
- Dynamic banner for use on external sites
- How do I store a custom dataset in WordPress to best take advantage of API?
- Nothing happens on WordPress Update command
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- A better way of getting draft posts that has a particular post meta using get_posts function
- Developing an IP lookup function using an API