Delete Guest carts from Prestashop

Over a period of time, you will find that your PrestaShop installation gathers shopping carts from Guest users or search engines that really don’t convert to orders but take up space in database. It will be good to be able to delete these and clean/free up valuable DB space for real customers!!

There are two ways to achieve this (PrestaShop Ver

1. Use the following SQL commands using any of your favourite front end (or even the commands line) to the PrestaShop database.

2. Modify the Back Office interface for Carts to allow interactive deletes

a) Edit admin/tabs/AdminCarts.php
b) Find $this->delete = false; and replace with $this->delete = true;
c) Go to Carts in Back Office and you should now see check boxes against the carts. Select and delete the ones you want to.

Hope this helps. View my shop (furniture items) at



157 votes
1 2 3 4 5

7 Responses to “Delete Guest carts from Prestashop”

  1. David said:

    Oct 22, 14 at 3:03 pm

    Here is the trick to only delete carts> 30 days. Change delay according to the type of customer you have.
    On my website, people tend to concentrate orders on the first 30 days.

    FROM ps_cart_product
    JOIN ps_cart ON ps_cart.id_cart = ps_cart_product.id_cart
    WHERE ps_cart.id_customer =0
    AND ps_cart.id_guest =0
    AND ps_cart.date_add < DATE_SUB( NOW( ) , INTERVAL 30
    DAY )

    DELETE FROM ps_cart WHERE ps_cart.id_customer = 0 AND ps_cart.id_guest = 0 AND ps_cart.date_add < DATE_SUB( NOW( ) , INTERVAL 30
    DAY )

  2. Jellygnite Brisbane Web Design said:

    May 22, 13 at 5:11 am

    If the guest cart has a creation date it would make sense to filter out recent ones. Otherwise you could be emptying someones cart who are online right now!

  3. paul D said:

    Apr 19, 13 at 1:05 pm

    any way to do this with prestashop 1.5.3

  4. Paul said:

    Apr 07, 13 at 9:02 am

    And how can we do this with prestashop 1.5.3

    Thank you

  5. Kalle said:

    Feb 05, 12 at 12:17 pm

    Great! That helped me alot too! Thank You so much.

  6. Aytunc Ozvural said:

    Jun 10, 11 at 1:29 pm

    Thank you very much. it was usefull. That helped me alot

  7. W. Ryan Jones said:

    May 31, 11 at 6:53 pm

    Thank you so much for this.. worked like a charm..

Leave a Reply