Title: Posting via backend PHP script/code
Last modified: August 21, 2016

---

# Posting via backend PHP script/code

 *  [j8h9](https://wordpress.org/support/users/j8h9/)
 * (@j8h9)
 * [13 years ago](https://wordpress.org/support/topic/posting-via-backend-php-scriptcode/)
 * Is there a simple api call I can make from a backend script to do the following:
   create a post, set the category and content (format an image in the post based
   on category)?
 * Does the email posting functionality allow the user to set the image and category?
 * Before I start writing some mysql inserts into the wp_posts table, want to see
   if there’s already a solution.

Viewing 1 replies (of 1 total)

 *  Thread Starter [j8h9](https://wordpress.org/support/users/j8h9/)
 * (@j8h9)
 * [13 years ago](https://wordpress.org/support/topic/posting-via-backend-php-scriptcode/#post-3785206)
 * So I found the wp function wp_insert_post()… If I create a php fileand include
   wp-includes/post.php, I can make the call — does the function handle the connection
   to the DB or do I need to make that connection… Still reading.

Viewing 1 replies (of 1 total)

The topic ‘Posting via backend PHP script/code’ is closed to new replies.

## Tags

 * [automatic post](https://wordpress.org/support/topic-tag/automatic-post/)
 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [email posting](https://wordpress.org/support/topic-tag/email-posting/)
 * [image](https://wordpress.org/support/topic-tag/image/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [j8h9](https://wordpress.org/support/users/j8h9/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/posting-via-backend-php-scriptcode/#post-3785206)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
