I was using the export/import functions in Wordpress to transfer stories to a new (clean) installation, and the import was causing a duplicate row problem in the wp_postmeta table which was causing the multiple authors plugin to list the importing user dozens of times for each story. My quick search yielded nothing, so I pulled out my arcane SQL knowledge and used some MySQL documentation to come up with this:
> create temporary table newmeta as select distinct post_id,meta_key,meta_value from wp_postmeta;
> truncate wp_postmeta;
> insert into wp_postmeta(post_id, meta_key, meta_value) select post_id,meta_key,meta_value from newmeta;
> delete from wp_postmeta where meta_key = ‘other_author’ and meta_value = ‘admin’;
> delete from wp_postmeta where meta_key = ‘other_author’ and meta_value = ”;
Note that you need to specify the column names that you know will reproduce the duplicate and you can’t use *. I had to do some additional cleanup because the import set ‘admin’ to be an author on every story, and produced some blank entries.
I also had to modify the multiple authors plugin due to this error that kept cropping up:
Warning: Invalid argument supplied for foreach() in
/blog/wp-content/plugins/multiple-authors.php on
line 46
Basically, I just made sure it checked that the variables it was using weren’t blank before it got to the foreach statement:
…
if ( $other_authors == “”) return; //INSERTED Line
foreach ($other_authors as $author) {
…
Pretty annoying, but not too hard to fix.