I would like to try build a simple plugin that collects and stores the name and email address of the person who filled in the form. I realize there are probably dozens of plugins out there that do this already but would like to build my own, for practice.
If the user enters their name and email address, where should this be stored? Should it be created as a “subscriber” custom post type or a whole new table in the WP database? What are your thoughts? I’d like to eventually export the data to a .csv file if that influences where it should be stored.
There are multiple storage mechanisms in WP so it can be bit tricky to pick one and sometimes there is no single right choice.
Let’s examine your criteria for storage:
As for me the best storage to satisfy these condition would be using custom post type. It comes with a lot of functionality out of the box (like admin interface), requires no messing with storage (custom tables or whatever) and is perfectly suited to store arbitrary information in custom fields.