• I am optimizing the database of my site that is using WooCommerce.

    When I came across the wp_comments table, I found it close to 100 MB in total. It’s all filled with WooCommerce order statuses from last few years.

    What’s the best way to decrease the size of my database?

    https://wordpress.org/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Are you referring the the order notes for when statuses are changed, stock is reduced, etc?

    You could delete this, but I would be careful doing so. Maybe target the comments with the comment_author being WooCommerce.

    Are you just deleting these for the sake of deleting them? Or are your database queries for comments running slow?

    Thread Starter ahuja55

    (@ahuja55)

    Thanks for your reply.
    I was just deleting it ,as it was close to 100mb.I believe if i dont delete,it will soon slow down site.

    Also whats the actual use of it in the comments table?
    Isnt there inbuilt functionality of clearing those?

    If i delete the comments with the comment_author being WooCommerce,wont the other tables like commentmeta need modified?

    Thanks for your support.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Also whats the actual use of it in the comments table? Isnt there inbuilt functionality of clearing those?

    The table is used to store comments. Why would you want to delete comments? This can be comments on your posts, reviews on your products, etc. Databases get big with the more data they need to store, that’s how it works.

    If i delete the comments with the comment_author being WooCommerce,wont the other tables like commentmeta need modified?

    From what I can tell, order comments don’t use postmeta. I can only track down postmeta for order comments that have been sent to the customer.

    Thread Starter ahuja55

    (@ahuja55)

    The table is used to store comments. Why would you want to delete comments? This can be comments on your posts, reviews on your products, etc. Databases get big with the more data they need to store, that’s how it works.

    Yes i understand comments on posts,reviews are important.But 90% of my comments table is filled with order status notes,like status changed from pending to processing,stock reduced etc.
    I meant to ask about them actually,where these type comments are actually used.And Isnt there inbuilt functionality of clearing those? .
    Because i dont think there is any need of that comment in table “order changed from x to x-1”.What do you think?

    From what I can tell, order comments don’t use postmeta. I can only track down postmeta for order comments that have been sent to the customer.

    Thats nice to know.I will check it.

    Thanks again for great work on plugin and amazing support!

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    I meant to ask about them actually,where these type comments are actually used.And Isnt there inbuilt functionality of clearing those?

    The comments are used in the order notes section in the order admin here: http://cld.wthms.co/18b43/bQPaPi5F. They are helpful when tracking down what has happened to an order, when stock was reduced, when the order was refunded, etc.

    You should be able to delete these comments for old orders if you don’t need them – there isn’t an automatic clean up / delete for them though.

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

The topic ‘remove WooCommerce comments from the wp_comments table’ is closed to new replies.