Title: Image Post Generator
Last modified: August 19, 2016

---

# Image Post Generator

 *  [askthefool](https://wordpress.org/support/users/askthefool/)
 * (@askthefool)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/image-post-generator/)
 * Hi everyone,
 * I did some searches and couldn’t find a quick solution. Is there any way to auto
   generate posts from upload of images? I have some 400 images that I’d like to
   be individual posts in wordpress, without going through and manually creating
   a post per page.
 * Not trying to make a gallery.
 * Help is much appreciated.
 * Thanks.

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/image-post-generator/#post-1397974)
 * [here ](http://wordpress.pastebin.com/4rYm3gPQ)is some code i started when i 
   had the same idea of turning a directory full of images into wordpress posts 
   each containing just the image and having the image name as title.
    hope you 
   can use it as a starting point to improve on. the code expects the folder to 
   be at the root of your wordpress installation – example folder is ‘gallery’ –
   if your wordpress is installed at [http://www.yoursitename.com/wordpress](http://www.yoursitename.com/wordpress)–
   then the image folder should be at [http://www.yoursitename.com/wordpress/gallery](http://www.yoursitename.com/wordpress/gallery).
 * **no guarantee that i will work**
    far from perfect: it saves the posts as draft;
   change it here to publish when you need it: `$my_post['post_status'] = 'draft';//
   or 'publish'`
 * i inserted the code into functions.php, and removed the comment slashes // from
   the function call at the end of the code; saved it – that would then create the
   posts; then edited it and put the comment slashes back.
    the code also echoes
   the image file information and the posts names when successfully generated, just
   infront of the theme.
 * i also added
    `sleep(1); //wait 1 second between posts` at the end of the function
   to avoid the sequence of posts to be mixed; remove it if that does not matter(
   would atherwise take a long while to finish with 400 posts).
 * hope this all made some sense, good luck 😉

Viewing 1 replies (of 1 total)

The topic ‘Image Post Generator’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/image-post-generator/#post-1397974)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
