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 want to add 2 more rows (for voting up or down) to my default wordpress posts table. Would those rows be deleted when I update my WP version, or cause any other problem? An alternative would be to create a separate table but it's much faster and easier to query from 1 in my case.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

First, I assume you're referring to columns, not rows. To answer your question, no, the upgrade process will not remove the extra columns from the posts table. That said, WordPress has the wp_postmeta table that should be used to store extra data about posts rather than adding columns to the posts table. I would suggest using the postmeta table instead of modifying the core database.

share|improve this answer
    
Thank you for the response! I wanted to add the columns to avoid complicated queries but I guess you're right. –  at least three characters Nov 18 '10 at 3:23
    
I'd strongly suggest following the advice given, using the existing structure will cause you less problems long term, and it's really not that hard to formulate queries to the meta table. You can most likely rely on the existing WP functions to perform your post/meta queries to.. –  t31os Nov 18 '10 at 23:28
add comment

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.