I want to delete a column from a table in WordPress.
I tried many ways but either they don’t work or they delete the whole row.
But I just want to remove the status column.
I have a lot of tables and I can’t delete them manually.
Is there a solution in WordPress?
I used the following code but it doesn’t work and it doesn’t remove the column
function remove_status_database()
{
$table_name ="wp_order_status";
$column_name = "status";
$drop_ddl = true;
maybe_drop_column($table_name , $column_name ,$drop_ddl );
}
2
Answers
I found the answer to my question. I can do a column with the following sql command.
Have you tried to do it with https://de.wordpress.org/plugins/wp-optimize/ ?
you can simple select the specific table and remove it.
hth
Stefano