Support » Plugin: WooCommerce » Transient customer_bought_product problem

  • Resolved Demian


    Hello Team,

    I have a major problem with native transients created by woocommerce. They are the transient _transient_wc_cbp_ and _transient_timeout_wc_cbp_. I believe they are created in the wc-user-functions.php file on line 209.

    We have around 40 transactions per day, but it creates after a couple of weeks 100K’s of these transient lines in wp_options. Sometimes it flows over 1M lines, and every time I need to empty the transients by going to woocommerce > status > tools > clear transients, because the database gets easily over 500MB. The site becomes slow because of this. There are no cron issues, I already checked.

    Why are these transients created and more important how do I avoid them?

    With thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Is the autoload column of your options table indexed?

    Thread Starter Demian


    Thank you @josk79 ,

    wp_options appeared not to have an autoload column. I have created this and see if it will improve.

    Due to the wp_options, does this cause also a bloated database for wp_postmeta (900K lines) and wp_comments (87K lines)? I have manually checked these databases, but I can’t find any duplicates or expired lines, they seem to be connected with the existing 14K orders. If so, is there a way to shrink them?

    Much appreciated!

    It didn’t have an autoload column? I don’t think that’s even possible. Or did you mean to say the column didn’t have an index?

    postmeta is not related to the wp_options stuff. This just means that you have a lot of posts (including products, orders, …). comments do also include the stock change notices for every order.

    FWIW: Automattic is working on incorporating separate tables for orders and products.

    Thread Starter Demian


    @josk79 yes my fault, incorrect wording. I mean there was no index.

    Could you verify for me if the following sizes are normal with these shop details:

    14K Orders
    500 review comments

    wp_postmeta: 890K records – 113MB
    wp_comments: 86K records – 35MB
    wp_woocommerce_order_itemmeta: 307K records – 36MB

    wp_comments is bloaded with order_notes and wp_postmeta is currently creating for each order 65 records. It’s a simple shop with 10 products and each 2 variants (so around 20 products).

    • This reply was modified 2 years, 8 months ago by Demian.
    Plugin Support Phillip C. a11n


    Hi @demian85,

    In your site Dashboard, please navigate to WooCommerce → Status → Tools tab. From there you should see the first two options are for clearing transients in your site. Please use these tools and test to see if the issue is resolved.

    I would also recommend scrolling about halfway down and use the Clear Customer Sessions tool as well.

    Please give this method a try and let us know if it fixes this issue.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Transient customer_bought_product problem’ is closed to new replies.