0

I 'd like to programmatically generate new pages for a site - the textual and visual components of the content are stored in a DB, this includes the names for the different locations the pages are for, links to the location specific images and custom description text.

My first attempt would be to code a template for the page the way I want it to look like with the different sections, elements etc and then retrieve the relevant content for each page from the DB (by using the corresponding reference names for the elements as defined in the template)and send it to wordpress (with a post request to the rest api presumably)

(This is a data analyst's attempt to automate a web development process.)

1) Is the above process feasible and meaningful ? (in theory)

2)Are there any plugins or instructions that would facilitate this (in practice) especially without reinventing the wheel ?

Clarification: The use case is the equivalent of having a list of hotels and locations and corresponding images and content in a DB (I haven't created that yet and it could be anything from an online spreadsheet to some storage service on the cloud - anything that can let me programmatically access the data.) The goal is that then if I want to add say a 100 new locations and create the corresponding pages I can do it instantly

  • Can you provide some context? What problem are you trying to solve by doing this? Is this an initial setup process? You mentioned a database, what is this DB? It's unclear – Tom J Nowell Sep 10 at 10:59
  • 1
    some context added as you suggested @TomJNowell – Alexandros Papageorgiou Sep 10 at 15:58
0

Sounds like you'd just be able to make a custom post type in WordPress, a page template that displays that post type, and then import new content at will.

If you will be importing large datasets and need pages created on the fly, you can probably use an importer plugin for that: http://www.wpallimport.com/

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.