Co-Authors-Plus icon indicating copy to clipboard operation
Co-Authors-Plus copied to clipboard

Can't assign posts to Guest Author during Import

Open MadtownLems opened this issue 4 years ago • 1 comments

When doing a standard import using the WordPress Importer plugin (https://wordpress.org/plugins/wordpress-importer/), you choose an Author to assign posts to. Unfortunately, Guest Authors don't appear to be selectable here.

Am I missing anything, or is this not possible?

Is there a suggested workaround, or might this be a useful feature that could be added? Thanks!

MadtownLems avatar Jun 30 '20 17:06 MadtownLems

Hey @MadtownLems I had a similar problem issue. I too would have loved this feature. I don't know if this works for your situation, but I was able to use the WP-CLI and a few co-authors-plus commands to import all guest users as users.

If you can get a list of your guest-authors (by hand, by SQL, etc) you can put them in a CSV file and import them as "real" WordPress users:

wp user import-csv foo.csv

Then import your posts.

wp import foo.xml --authors=create

Once all the posts are imported and match up with their local account (this gist is helpful for that step) you can then migrate the user accounts you only want to be guest accounts.

A few bits of more information that might help:

https://wpvip.com/documentation/add-guest-bylines-to-your-content-with-co-authors-plus/#migrating-users-to-guest-authors-with-wp-cli

https://github.com/Automattic/Co-Authors-Plus/blob/master/php/class-wp-cli.php

ckoerner avatar Jul 23 '20 16:07 ckoerner