Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was just wondering if there is a compelling reason to not let a plugin add columns to a core WordPress database table, such as wp_term_taxonomy. I could always create a separate table and join it to the WordPress core table, but I would prefer to keep the additional data that my plugin uses in the standard WordPress tables.

Is there a downside to using this? Could I expect stuff to mysteriously start breaking?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Two Problems

Problem #1 - You shouldn't ever change the default schema that ships with WordPress. This schema might change in the future (entire tables could be dropped and re-built in an update).

Problem #2 - You shouldn't really be creating new tables in the first place. If you create a new table with your plugin it might work just fine in a single installation. But what about Multisite? What if it's network activated by mistake? Now you're not creating 1 new table, but potentially thousands of new tables on some installations.

A Different Question

The question you should be asking isn't of what to do with the tables, it's where to store the data. Why not use a custom post type to store your custom data? There's almost always another place to put your data that doesn't require you to add tables to the database.

share|improve this answer
    
Thank you for the answer. What I am trying to do specifically is attach custom metadata to any taxonomy. I'll look for a less-invasive solution. –  Andrew Jul 23 '12 at 17:17
    
Perhaps you should ask a new question detailing what you're trying to accomplish ... –  EAMann Jul 23 '12 at 18:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.