How to rename custom table name programatically in wordpress?

Yes, you can use the query function to rename tables. global $wpdb; $oldTable = $wpdb->prefix . “wpfd_docs”; $newTable = $wpdb->prefix . “ccdm_docs”; $renameOk = $wpdb->query(“RENAME TABLE ” . $oldTable . ” TO ” . $newTable); if( $renameOk ) { echo ‘All good’; }else{ echo ‘Failed to rename table. Last DB error: ‘ . $wpdb->last_error; }

Same Plugin tables between wordpress installations

It is not possible to know without inspecting the plugin itself on a case by case basis. Doing this requires a unique answer for every specific plugin. There is no general answer that works for all or even some WordPress plugin tables. Every plugin is unique and will have a different answer, some will be … Read more