I'm working on a rather odd implementation that stretches the limits of WP a little - its a healthcare site where patients are a custom post type and procedure requests related to each patient are stored in comments on that post. I started off by storing alot of data in commentmeta, but I want an easier way to access it than having to pull from a meta table. I'd also like to be able to use the built-in functions where available (wp_insert_comment can set most of the fields in wp_comments table through the arguments passed to it).

My question is - where are these other values set and accessed in WordPress? Specifically, I'm curious about:

  • comment_karma
  • comment_type
  • comment_approved

I have one meta value I want to set, which I'm hoping to use comment_type for. I also want to set a flag on each request to show whether or not it has been confirmed and responded to. It seems like comment_karma would work well for this, as it is completely unsused, although I'm not sure if it can be set directly with wp_insert_comment.

Are there any consequences I should be aware of when doing this? Would I be better off just adding additional columns to the table, or does this approach sound like it would work?

  • There was a short movement to remove it for version 3.1 ... but since some systems still hook onto it, it's staying there for now.
    – user19256
    Aug 14, 2012 at 20:59

3 Answers 3



This field is used by a few plug-ins to help you manage your comments. There are a few good articles explaining its exact use floating around on the Internet. But you should note that this field is actually just not used. As Mark Jaquith said once, it's a "there if you want to use it this."

There was a short movement to remove it for version 3.1 ... but since some systems still hook onto it, it's staying there for now.


Is this a comment, a trackback, or a pingback? This helps theme devs separate out the different types of "comments" in the front-end display.


Is the comment pending moderation, spam, or approved by the author? Just helps you manage what is and isn't OK for display on the site.

  • comment_karma - no idea, doesn't seem meaningful in current code;
  • comment_type - this marks pingbacks/trackbacks, empty for normal comments;
  • comment_approved - approval (0 or 1) and spam (spam) status.

On your usage - why not just create custom post type for procedures? Comments are much less flexible than posts and kinda single-purposed in nature.

  • I found you can set comment_karma through wp_insert_comment() - so that's good for me. I thought about a custom post type, but the structure of comments (threaded, built-in capabilities, and automatically tied to a post) was so close to what I needed, I hoped not to have to reinvent that wheel. Jan 6, 2011 at 20:56

comment_karma can be used like Stack Exchange votes but I did not see any plugin utilises it before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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