- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody, this is my first post here.
I just deleted all of my products in my Magento 2.3.4 but still i see numbers next to my subcategory's. When i go to catalog / Category..
How can this be and how can i solve this?
as you can see, i have 0 products..
What can i do to make these numbers go away?
thank you very much for your help.
Kind regards,
Andy
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @andyavcons30c7
You can try the below query to clear the data from category mapping table.
To make sure the results. select * from catalog_category_product where product_id not in (select entity_id from catalog_product_entity);
To delete the records.
delete from catalog_category_product where product_id not in (select entity_id from catalog_product_entity);
If you are using prefix for table then change table name accordingly.
I hope it will help you in future as well!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deleted all products but still see numbers in subcategory's?
Hi Andy
Have you cleared your cache and reindexed?
Reindexing will most likely solve your issues as it will "recount" all of the products in the category and show the correct number.
Magento Solution Specialist, 10 year Magento user, store owner and Agency Director
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deleted all products but still see numbers in subcategory's?
Thx @Rixxo i tried this in ssh with this code
php bin/magento indexer:reindex
and then with
php bin/magento cache:clean
but he's still showing the number of products that aren't there :-)
forum3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deleted all products but still see numbers in subcategory's?
Would it be an option to delete everything in these table? mg_catalog_category_product ? in the sql? i see that there a still a lot of id's in there
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deleted all products but still see numbers in subcategory's?
Ok, i deleted everything in mg_catalog_category_product and it worked :-) everything is back to 0.. yesss
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @andyavcons30c7
You can try the below query to clear the data from category mapping table.
To make sure the results. select * from catalog_category_product where product_id not in (select entity_id from catalog_product_entity);
To delete the records.
delete from catalog_category_product where product_id not in (select entity_id from catalog_product_entity);
If you are using prefix for table then change table name accordingly.
I hope it will help you in future as well!