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

I have a scenario where we would like to post to our blog via email. However, it needs to be to a custom post type. I've done a bit of research but haven't found any examples or ideas on how to do this.

Any help would be appreciated.

share|improve this question

When a post is submitted by email and published WordPress Runs an action hook named 'publish_phone' so you can get the post there and change its type like this:

function custom_type_by_mail($post_id){
    $p = get_post($post_id,'ARRAY_A');
    $p['post_type'] = "YOUR_CUSTOM_TYPE_NAME_HERE";

Probably not the smartest way but it does work and its simple.

share|improve this answer

Your Answer


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.