I would just modify Q Studio example to:
global $wpdb;
$table = $wpdb->prefix . 'table_name';
$delete = $wpdb->query("TRUNCATE TABLE $table");
Related Posts:
- Delete tables from database when deleting plugin
- How can I delete orphan keys in WordPress database tables?
- Using Vagrant for customizable WordPress Multi-sites [closed]
- clean wp_options table unused rows
- Doubt using $wpbd->get_col for a single column
- Access WordPress database outside of WordPress
- Help With MySQL to WPDB Query Conversion
- Create a table with wordpress plugin boilerplate
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- WPDB: Update table
- Issue running db create table query from static method
- Add some fileds to the wp_posts table
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- How to access the WordPress DB from a plugin file
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- Integrating Custom Database with WordPress
- $wpdb->delete not working for me
- How to securely controlling data without keeping it in postmeta?
- How to fix slow comment query?
- Write mysql credentials in plugin
- get_var result empty for query of custom table in plugin admin
- Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet
- Posts are deleted everyday at night
- Is it safe to increase/alter the size of the wp_post.guid column from VARCHAR(255) to VARCHAR(2048)?
- Plugin Options Not Saving to Database in WP 4.5
- JS Support Ticket – Auto create WP account
- How to show Recent Page instead of Post?
- Remove Duplicator plugin from admin menu if not an administrator
- Input with spaces in Shortcode attributes overwritten by defaults
- How to create custom tables in WordPress using my own plugin?
- Add a custom form on the post-new.php admin page
- How to access data in wordpress database externally using php
- Removing customise fields during plugin uninstallation
- Correct way to perform non-cacheable DB query
- Is it possible to create Custom Post plug-in?
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Translating long texts with html formatting
- WordPress Settings Lost After Site Migration
- How would I go about creating a user ranked post popularity page?
- Anonymous Postings
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- custom user tables supported in SharDB plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- Creating mySQL procedure with $wpdb
- DROP TABLE with uninstall hook not working
- How to check if tables in WordPress still exists after activations
- how to oauth1 Wp plug-in revoke/reset.?
- Problem with creating tables for Plugin
- Disable woocommerce cookies and delete cart data automatically
- Prevent duplicate records in plugin table
- className not populating in custom block
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Run plugins only on certain pages
- Change commission_status paid when withdraw_status vendor is completed
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- Display encrypted content on my website
- How can I perform high-level database merging for WordPress within continues delivery?
- Delete query not working in plugin
- How to remove traces from widget during uninstallation
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- $wpdb->replace: WHERE?
- Use of Templates in a Plugin
- Why can’t I access my Intranet LDAPS with NADI?
- How do I network enable a plugin for a multisite install via the database?
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- WordPress Backend HA (Automatic failover)
- import posts with dutch/special letters
- Automatic switch to backup database on fail
- Customization API for plugin development
- $wpdb->get_row returns column name instead of column value
- How can I change the meta_key for a particular piece of information?
- Fromcraft Plugin On click submit button [closed]
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- WordPress Integration with Google Groups
- creating a custom shop page display on archive woocommerce
- Setup page on first login on multisite
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- How do I make a child theme I made POST through a 3rd party plugin?
- wp_editor content in plugin options page
- How create Group Blogs based on user created Groups
- Multiple instance of data in plugin custom database table on plugin activation
- WordPress and a secondary database?
- WordPress plugin creating database in localhost but not on real host
- Why this function not working for install database on plugin activation