Title: Automatically generating wordpress pages
Last modified: August 20, 2016

---

# Automatically generating wordpress pages

 *  [mpsbhat](https://wordpress.org/support/users/mpsbhat/)
 * (@mpsbhat)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/)
 * Hello..,
    I am using WordPress for designing front end for my office project.
   Aktually my project is based on survey and there are few surveyors on field who
   surveys location data and take images. Then they uploads the surveyed data to
   our mysql database via internet. Now I want to automatically generate wordpress
   pages based on surveyed data instantly when the data is updated to the database.
   Is it possible? How can i achieve this? Someone please help.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560472)
 * Unless the data is uploaded through WP, it has no way of detecting the added 
   data as it happens, so instant pages are probably not possible. It should be 
   possible to schedule a hourly task to identify data that does not have associated
   pages and create new pages for that data.
 * It is not instantaneous, but perhaps it is timely enough?
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560479)
 * If you have access to the database with the extra data in it it is possible, 
   but it’s a bit of work.
 * What you’d need to do is set up a [CRON function](http://codex.wordpress.org/Category:WP-Cron_Functions)
   to check for new data in the database. If new data is found, read it and create
   a new post/page/wahtever in the WordPress system and mark that row of data as
   processed so it’s not added again in the next CRON round.
 * That’s a pretty simplified version of how it would work, but it is definately
   possible. You’ll just need to look at your own data and how you want it set up
   on the pages to be able to see how you want it done.
 *  Thread Starter [mpsbhat](https://wordpress.org/support/users/mpsbhat/)
 * (@mpsbhat)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560497)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/) – It is enough to create
   pages as time driven (periodic) event. But should be programatically. How it 
   is possible?
 *  Thread Starter [mpsbhat](https://wordpress.org/support/users/mpsbhat/)
 * (@mpsbhat)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560499)
 * [@catacaustic](https://wordpress.org/support/users/catacaustic/) – can u give
   some code samples to achieve this?
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560500)
 * You can use the WordPress CRON as I linked above, and to create the posts you’d
   use [wp_insert_post()](http://codex.wordpress.org/Function_Reference/wp_insert_post).
   Apart from that it’s hard for me to say to much because I don’t know what your
   data is, how it’s meant to e formatted or any other details that would be needed
   to actually do this. Like I said it’s not a small job. I don’t think that it’s
   a big job either, but it’s more then what a few lines of code in here would be
   able to portray. But the basic process would be:
    1. Check database a data row with no post ID assigned to them
    2. Do whatever processing is required to get the new data row into a format that
       can be used in your post object/page
    3. Save the post using wp_insert_post() and keep a note of the post ID
    4. Record the post ID against the data row that was just processed
    5. Repeat from step 1 until there’s no more un-assigned data rows

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Automatically generating wordpress pages’ is closed to new replies.

## Tags

 * [automatically](https://wordpress.org/support/topic-tag/automatically/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 5 replies
 * 3 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/automatically-generating-wordpress-pages/#post-3560500)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
