Create Pages from Database

There seems little point in creating a new post entry for each of your products if your table of products already has all of the information you wish to display.

Your best bet is to create a single page for example “Product” and then setup your own rewrite rule, using add_rewrite_rule, so that you can setup links such as /product/some-product-alias. You would then need to perform a query on the product alias to lookup the product information from your product table and then display this on the template (either use page-product.php or create a template and assign this in the admin)

There’s a little more information on setting up the redirects in this answer of mine.

Leave a Comment