I have a huge website, with thousands of pages. It's a reference site, with a page for every country, each U.S. state, every species of mammal, etc.

I've tried WordPress on some smaller sites and love it. Now I'm trying to figure out if there's a way to convert my reference site to WordPress.

So here's my first question. If I replace this site with WordPress, is there some way I could automate page creation? For example, let's say I want to create 250 pages for countries and 50 pages for U.S. states. Rather than create each page one at a time, I'd like to just push a button and let WordPress instantly create 300 pages, each with a specific title, URL and channel (Nation vs State).

Is there a way to do this?

  • 1
    Creating 300 pages from a single button may timeout, consider a WP CLI command instead so that time limits don't get in the way of what you're trying to do
    – Tom J Nowell
    Jun 3, 2017 at 1:26
  • 1
    Discussed a few examples of non-WP to WP automation/migration on this answer earlier this week: wordpress.stackexchange.com/a/268853/118366 Personal preference would be using a wp-json endpoint as a webhook and writing something for the non-wp site that POSTs to that endpoint.
    – hwl
    Jun 3, 2017 at 4:14

1 Answer 1


Where is the content coming from? You can easily write PHP code that will create pages, but the content has to come from somewhere.

If the content already exists, say in a database that you own, then you can code a process to take the data from a table/record and convert it into a post/page.

  • I have a system that uses two parallel series of database tables. The first series of DB tables specify the URL's, page titles, metadata, etc. The second series of tables store the content.
    – WordBear
    Jun 3, 2017 at 1:20
  • Since you have a 'source' for your content, then this should get you started developer.wordpress.org/reference/functions/wp_insert_post . Just put your content etc into the appropriate array elements, and your good. Once you get the process tested with one post, just loop through your data with that process. Jun 3, 2017 at 18:45
  • Great tips, even if I don't understand most of them. ;) I think I'm going to have to hire a local pro to help me with this, but all of these tips will help me get pointed in the right direction.
    – WordBear
    Jun 4, 2017 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.