Couple of days ago I was checking the size of my database and I was amazed on how huge it is. The most weird thing for me is that my site is not using comments, and still the wp_comment table is more 27MB. When I took a look inside I saw this for example – a comment from Woocommerce saying this in the content – Order status changed from Pending Payment to Proce… or this IPN payment completed.

Now I use many plugins on the site, but I`m still not sure why orders status should be in wp_comments. Also in the backend of WordPress, there are zero comments in spam, approved or trash…

What shall I do? Shall I remove all comments there? I thought WordPress is writing in the orders tables for this purposes…

2 Answers
2

Oh, that is double offtopic, but for the sake of helping other people which might wonder the same about EDD and maybe other plugins, the reason is because wordpress core to not have any easy support for hierarchy between CPTs except for comments being under posts. As orders are “belonging” to specific products it makes a simple hack to emulate such a relationship by using comments.

Why not just store order in separate table? because on wordpress.com which is one of the biggest wordpress hosters in the world plugins are not allowed to create new table, therefor WC and EDD had to come up with some hack.

What should you do? probably nothing, why do you even look at the DB in the first place? Checking out the architecture of code is something you should do before putting it on production. After it was running for a while it becomes too late to think about alternatives.

Leave a Reply

Your email address will not be published. Required fields are marked *