Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

A WordPress site I'm doing a redesign for has around 1.400 posts by approximately 30 different authors. Unfortunately the authors of the posts have so far been entered as a custom field within the post, and not as separate authors in WP.

I'd like to transfer this to the 'proper way', where each post has an author attached to it, since this would make it possible to display more posts by each author without resorting to plugins like Search Everything.

Does anybody know of a script that could look through all the posts, search for the custom field containing and author and create that author, and then link the post to that author? (I know, long shot...)

Is that even possible or is there an another way apart from going through 1.400 posts and changing them by hand?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Not knowing your specific setup makes this pretty tricky ... but here are some ideas for alternatives that might save you time:

Leave it as-is

If these authors aren't actually users of the site to begin with, don't change anything. Non-users shouldn't be turned into users just for the sake of making search easier. Creating so many non-user user accounts will open up just that many potential entry points for malicious visitors.

Create a taxonomy

Again, assuming these authors aren't actually users ...

Create a custom "Authors" taxonomy and dump the author names in there. Taxonomical data is pretty easy to use in a theme to change styling, add attribution, etc. It also gives you archive pages and search functionality so you can index by author name.

The long way

If these authors absolutely do need to be turned into users ... you've got a lot of work ahead of you. I'd recommend sitting down with phpMyAdmin and running some queries:

  1. Run a query to get a list of all author names
  2. For each author name, run a query to see if that author exists
  3. If the author doesn't exist, run a query to create a dummy use for that author

Yes, it will take a while ... but I'm hoping you don't have 1,400 different authors for your 1,400 different posts. Your first query should return maybe 100 or so (hopefully you don't really have 100 different authors!) results ... that should definitely save you some time!

share|improve this answer
    
Yeah, in the end we went in there and did it the long way... by hand. Pain in the arse but we got there in the end. Thanks for replying! –  Squrler Oct 21 '11 at 2:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.