title: What is best practise for storing custom data for Wordpress
body: <p><strong>Context:</strong> I need to create a form with a lot of customisations and quite a few fields (20+) for a site and rather than installing a plugin and modifying the hell out of it (or learning the plugin's API) I decided to write my own plugin. Since I'm doing this from scratch the question of storing data had to be answered.</p>
  
  <p>Most people will suggest using a custom post type and meta data rather than a custom table and while I'm familiar with custom post types and taxonomies etc I wonder whether this is best for pure data storage that amounts to a log. </p>
  
  <p>The form is single use and the data I'm storing won't be accessible on the front end of the site and will only be "viewed" on WP-admin and that would most likely just be a single page with a filterable table.</p>
  
  <p>So the question is does this warrant using a custom post type and meta-data or should I just create a table and use the $wpdb class since that simplifies CRUD and still sticks to the "Wordpress way" of doing things.</p>
  
  <p><strong>Reading:</strong> <a href="https://pippinsplugins.com/custom-database-api-reasons-for-custom-tables-and-an-api/" rel="noreferrer">This post</a> makes a good case for a custom table, especially since their example is about storing private data, questions of efficiency and privacy arose. <a href="https://stackoverflow.com/questions/19546873/wordpress-custom-table-or-custom-post-types">This question</a>, answered a few years ago has the opposite opinion but the use-case was different since the data being stored was for public display.</p>