WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

hope someone can help.

I have my WP install configured to capture posts via a front-end form. Users do not log in, which is an explicit requirement. The author should be set based on a custom post field (by matchting the emailadress filled out in the form). Authors do have a profile already.

I found the wp_insert_post_data() function, assuming this could provide what I was looking for, and wrote a small plugin to set the author from default to submitter. However, it changes the post data before it is inserted into the database. Ergo: it can't set an author based on meta for a post that isn't inserted/doesn't exist yet. In effect, submitted posts don't have an author at all.

How can I work around this problem and automatically set the author of a post based on a custom field within that post after the post is created? I've been combing through the references/codex but couldn't recognize anything that could solve this.

Any suggestions? Hope so!

Best of luck & cheers,


share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.