WooCommerce: Remove Cross-Sells @ Cart Page

A client wanted to completely remove the area on the Cart page where “You may be interested in…” cross-sell products show.

This is helpful if business needs change at some time and you don’t want to manually remove cross-sells from each single product in your store by hand. Enjoy!

WooCommerce: remove cross-sells on the Cart page
WooCommerce: remove cross-sells on the Cart page

PHP Snippet: Remove Cross-Sells @ WooCommerce Cart Page

 * @snippet       Hide Cross-sells @ Cart
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 6
 * @donate $9     https://businessbloomer.com/bloomer-armada/
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );

Where to add custom code?

You should place PHP snippets at the bottom of your child theme functions.php file and CSS at the bottom of its style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my guide "Should I Add Custom Code Via WP Editor, FTP or Code Snippets?" and my video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything went as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting.

If you think this code saved you time & money, feel free to join 17,000+ WooCommerce Weekly subscribers for blog post updates and 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance!

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

43 thoughts on “WooCommerce: Remove Cross-Sells @ Cart Page

  1. I put the code in my functions.php but it does not work anymore.

    1. Thanks for your feedback! So it used to work? Are you able to pinpoint what happened on the site when it stopped working e.g. a third party plugin update?

  2. Hi Rodolfo,

    Love the code snippets you provide, I have used quite a few of them already!

    Just wondering if you would know how to HIDE certain products from the catalogue but, display them as cross sells at checkout ONLY.

    For example, products A,B & C are included in shops inventory but, only product A is displayed in shop’s catalogue. When product A is placed in basket, products B & C are displayed at checkout as cross sells.

    Thanks in advance

    1. Hi there thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  3. Hi Rodolfo,

    “I will create & install your child theme” link doesn’t work anymore. Goes to a 404.

  4. Thank you so much, now my cart page is seems clear without distraction

  5. Hi Rodolfo,
    Is it possible to replace the cross-sells with recently viewed?
    This would remove the hassle of setting up cross-sells and at the same time ensure customers on the cart page are only viewing something they’ve already shown interest in.
    Any suggestions on how this could be achieved would be very much appreciated ๐Ÿ™‚
    Kind regards,

    1. Hey Jon-Paul, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  6. Thanks so much for the code. I have the Maxstore Pro Theme and it worked perfectly for me. I don’t mind having the cross sells on the product pages but to have it on the cart was forcing customers to scroll to much. They are at the check out page for a reason and i don’t want to distract them from clicking the “proceed to check out” button. This code you gave us is exactly what i needed!

    1. Awesome!

  7. Code still works Rodolfo. Running WooCommerce 3.6.2 and WP 5.2 on a Storefront theme.

    Thanks for this.

    1. Great!

  8. Hi Rodolfo, How can I hide product from shop but show it in cart as cross-sell. I need to unset other shipping methods than homedelivery if you choose pooltable installation and it seems to be fairly hard to do with woocommerce product addons. If I would make installation as products and only cross-sell those it would be easy to unsett shipping methods.

    1. I found a dirty way of doing it by creating a new category, excluding that category from shop
      then unset other shipping methods if that category is in cart and cross-sell it.

  9. Thanks for sharing… what a great resource this page is. I learned a lot. Any idea on how one can change the view of the cross-sells from list to grid? The rest of my site uses list, but it takes up way too much room on the cart page.
    Thanks for any insight you can offer

    1. Hello Randall, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  10. Hi,

    You seem like a nice guy! ๐Ÿ™‚ Thanks for the snippet, but unfortunately it doesn’t work for me.
    I tried to put it on all places, and I also used the snippets you put in the comments but those doesn’t work either.

    I just want to have everything removed haha.


    1. Hey Tom, thanks for your comment! It could be you’re using a custom theme and this default cross-sells code won’t work. Try for a second with a different theme and see if that works ๐Ÿ™‚

  11. Hi Rodolfo,

    Thanks so much for all the great examples! One issue I have is that the above code does not remove the default instance of the cross sells. It does correctly add the new instance at the bottom of the page, but now I have two separate cross sell boxes on the cart page…not ideal.

    Any thoughts what I can do to remove the default one?

    I’ve tried a CSS solution, but that removes both instances.


    1. Hey Nick, thanks for your comment! It could be that you need to call the remove_action later on (after it has been added) – or that your theme is overriding the cross-sells and therefore you need to tweak the code accordingly. Hope this helps ๐Ÿ™‚

  12. Excellent – I recently migrated to WordPress/Wwoocommerce cart and this is one of the handful of little things that I needed to change. I thought it would be tricky but your blog made it simple and (best of all) it just worked first time. Nice tip!
    Cheers, Nick

    1. Brilliant, thank you Nick ๐Ÿ™‚

  13. Hi, thanks for your article, I’m wondering how I can add a single cross sell to all my products without going through each product separately and changing them in the WordPress admin. Do you know of a way to do this in bulk?

    1. Hey CK, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

  14. Hello Rodolfo!
    My problem is my cart layout doesn’t look like yours on the picture. But i would like it to be just like it-right now my cross-sells are under ths hipping calculator so it is kinda not seen by anyone. I would like it to be next to the calculator either on the right or left side.

    1. Hey Dani! Thanks for your comment ๐Ÿ™‚ What theme are you using and can you also give us a link to your website? This would help! ~R

      1. Hey!
        https://www.dronkiraly.hu/ (test phase yet so dont be surprised:D)

        1. Thank you ๐Ÿ™‚ I will need to take a look at the Enfold theme files in order to give you a PHP fix. For now, you can use this (not ideal, but it works):

          // Enfold Theme CSS to Remove Cart Cross-Sells
          .woocommerce-cart .cross-sells {
          display: none !important
          1. I mean i don’t want it removed, i just want it to be near the shipping calculator and not below it.

            1. Hey Dani, for this I will need the Enfold theme files or at least to access your Cart page (broken at the moment) ๐Ÿ™‚

          2. Its good now. Yes, sure, i made you an account(emailed to bloomer mail) Thank you:)

            1. You’re trying to override cart.php there but it’s not necessary. You’ve probably broken a few things in the code as well ๐Ÿ™‚ Remove the Cart.php override and then I’ll see what I can do ๐Ÿ™‚

          3. Sure, did it ๐Ÿ™‚

            1. Looks better ๐Ÿ™‚ Here you go, you can do it via CSS, no need to use PHP:

              .cart-collaterals {
                  width: 50%;
                  float: right;
                  display: block;
              .cart-collaterals .cart_totals {
              width: 100%
              .cross-sells .cross-sells {
                  float: left;
                  width: 50%;
                  display: block;
                  padding-top: 0;
                  margin-top: 0;
                  border: 0;
          4. O awesome, thanks alot man, you are great!!!:)

            1. ๐Ÿ™‚ You’re welcome!

  15. Hi Rodolfo As I have only recently relaunched my website http://www.brownbinrescue.ie as mobile optimised and powered by Woo I will want to see as many of these trusted snippets you selflessly share with us all. My site has a Related Product route which I think is much better than the above presentation which yes would drive a customer mad.

    Thanks Rodolfo

    1. Thank you Denis for the feedback – much appreciated! I love when you say “trusted snippets you selflessly share with us all”, I was never given such a compliment! It may become my new tagline ๐Ÿ™‚

  16. Thank you so much for sharing your knowledge with us! These snippets are very useful!!!

    1. And thank you so much for your comment ๐Ÿ™‚ Keep’em coming!

Questions? Feedback? Support? Leave your Comment Now!

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

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