Title: Plugin example that creates new tables?
Last modified: August 18, 2016

---

# Plugin example that creates new tables?

 *  [bucky](https://wordpress.org/support/users/bucky/)
 * (@bucky)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/plugin-example-that-creates-new-tables/)
 * I am looking for code that correctly handles table creation for a plugin. wp_postmeta
   won’t be the right thing for what I have in mind (my Primary key would be a WikiWord,
   for one thing).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/plugin-example-that-creates-new-tables/#post-220062)
 * If you just want to add data to the wp_options table (which seems to be common
   practice), just read through this guide: [http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database](http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database)
 * I have only used three plugins that actually create database tables. They appear
   to create the tables upon activation and seem to require WP’s upgrade scripts
   to do so. Here are the plugins:
 * [http://www.ioerror.us/software/bad-behavior/](http://www.ioerror.us/software/bad-behavior/)
   
   [http://unknowngenius.com/blog/wordpress/spam-karma/dev/](http://unknowngenius.com/blog/wordpress/spam-karma/dev/)
   [http://uberdork.supertwist.net/2005/03/13/plug-it-in-plug-it-in/](http://uberdork.supertwist.net/2005/03/13/plug-it-in-plug-it-in/)
 *  Thread Starter [bucky](https://wordpress.org/support/users/bucky/)
 * (@bucky)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/plugin-example-that-creates-new-tables/#post-220174)
 * thanks, I see the pattern to use now! cheers

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin example that creates new tables?’ is closed to new replies.

## Tags

 * [db](https://wordpress.org/support/topic-tag/db/)

 * 2 replies
 * 2 participants
 * Last reply from: [bucky](https://wordpress.org/support/users/bucky/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/plugin-example-that-creates-new-tables/#post-220174)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
