[wp-hackers] Remove Excess DB Info?

Stephane Daury wordpress at tekartist.org
Thu Nov 22 04:15:35 GMT 2007


On Nov 21, 2007, at 22:39, Computer Guru wrote:

> Quick question:
> Anyone know of an easy way to drop all columns not part of the  
> original WP
> schema from a database? Over the years I've accumulated several  
> columns (by
> several I mean around 30-50) that shouldn't be there and wanted to  
> know if
> there's an easier way than dropping each column one by one.
>
> Thanks.

It probably isn't what you want to hear but:
1) write an SQL script with all the laters (with cut-n-paste, it's  
actually faster than any GUI tools, confirmation steps and all).
2) OR ultimately: backup, drop the schema (or all), restore

In any case, *trust me*, you don't wanna do it any other way than one  
by one, because any automated mishap would suck really hard.

But the safer one, if you really wanna drop ALL the customs columns is  
#2, and doesn't have to mean more than a few seconds down time (if  
any) if you restore to a new schema without dropping the old one and  
then just change your wp-config to point to the new schema.

Stephane



More information about the wp-hackers mailing list