Custom database or Custom Post Types?

I have been searching throughout the web for the best way to implement what I need but just cannot find a best solution as there always seems to be some drawback. I’d prefer to do it right the first time and it’s been weeks trying to find the best solution.

On my current website, I need to add listings of businesses with their various information such as address, phones, URLs referring to the business, etc. There would be 30+ fields and as you can see with the example of the URLs there can be many URLs which refer to the business.

Read More

I’ll need another list with its own data which will be a many to many relationship to the businesses.

I know SQL and could easily do this in C# ASP.NET but am trying to find the best way to do it with WordPress. I will be using the Genesis framework if that matters. It appears I have 3 solutions:

  • create custom tables in the WP database
  • use Custom Post Types with many custom fields
  • rely on a plugin

Custom tables: It seems easy to retrieve the custom table info via SQL code but it looks like I would have to create an admin and especially if I want it to appear in the admin dashboard for ease of use to modify the tables.

Custom Post Types: They seem like they might work but then I’d need a way to do the many to many relationship and the solution there seems to rely on a plugin like Posts 2 Posts. Also I’m not quite sure how easily it is all managed since it seems like there would be many WP pages to navigate instead of having perhaps one UI.

Plugin: I have seen some recommended but then you’re at the mercy of hoping the author maintains the plugin and then what happens if it breaks hence killing your website.

So to the more experienced WordPress users out there, if you were going to tackle this project, which method would you use? Thanks!

Related posts

Leave a Reply

2 comments

  1. Generally, creating your own tables is discouraged. Back in the day, it was common to see plugins create tables. In a lot of ways, plugin authors didn’t have much choice, but it did make a mess especially because it was common for plugins not to clean up after themselves. I get that, and agree that publicly released themes and plugins should not create tables if it can be avoided.

    Having said that, I would lean towards creating the tables. I’ve done something much like what you describe and maintaining and improving that subsystem is still a big part of my job. I have considered post types but can’t convince myself that they would really work for the business listings, though I am using them for a ‘business bio’ component. The relationships I need, the searches, the performance… I just don’t think it would work if I hadn’t built my own tables.

    Yes, you have to build your own interface but the “post”-like interface makes no sense for the data anyway, at least not for mine.

  2. Use PODS plug and its extended posts functions. I tried everything and this is the best! Also, you can use Pods for your own tables in wp database and use them as objects. Go to Google and just type: wordpress pods. After adding your content fields, just use them as post meta fields.