Kinetic Pulse
  • Home
  • Services
  • Portfolio
  • Blog
  • Terms
  • Contact

Easier deleting of multiple products in Magento

June 5, 2011

Anyone who has used Magento knows that deleting muliple products can be a slow & tiresome process – the “Delete All” function will often result in Server 500 errors if you have more than 100 products.
Up until now I have just bitten the bullet, put some good background music on and deleted the products a page at a time (inwardly cursing that Magento promises so much and delivers little)
But having to do lots of product imports I thought I’d investigate a better way of deleting.
I found this splendid blog post by Sonassi here:
http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-delete-products-in-magento

Which goes some way to showing how its done.
1) Basically I took their code and put it into a php file called “mass-delete.php“
2) I put this file in a subfolder in my magento site (“my-functions“) – for neatness
3) I edited my .htaccess so i coudl run functions from thsi folder – find teh other similar looking lines and add:

RewriteCond %{REQUEST_URI} !^/my-functions/

The php file also needs editing if you want it to run on ALL products. Just remove the line that says:

->addFieldToFilter('data_set', 1544);

Then you’re ready to run this in your browser:

http://www.yoursite.com/myfunctions/mass-delete.php 

Warnings:
1) This script does take a long time to run. Mine has caused Server 500 errors – but I’ve found its best just to re-refresh the page and it starts off where it left off
2) Whatever you do make sure you let teh script finish what its doing. Becasue at teh end of the script it switches the inedex types back to Update on Save (as it turns  it to Manual at the start) which wil mean your site behaves normally once again. (I didn’t and couldn’t see any of my products. Took me a while to realise I have to change the update types on my indexes manually)

I hope this helps anyone getting that Sonassi script to work for them

Share

Facebook Google+ Twitter Pinterest Email

Back to Blog

Testimonials

I like it.  I like it a lot !!!

 You have interpreted what I wanted to achieve perfectly considering what you have to play with i.e not redoing the whole thing in the process.

Fiona Simmons-MooreSouth Gloucestershire Parents & Carers
Absolutely fantastically professional web developer – I would highly recommend!!! Thank you so much Kinetic Pulse!
Tania MarstonDoris Designs
Amazing and brilliant, Kinetic Pulse have lifted a dream to reality, Highly recommended and great if you are total novice, they know their stuff…Thanks again
Annie LindridgeSalt Yourself Out
Thank you for all of your hard work its looks fab and I am over the moon with it!
Amanda MercerAmanda Mercer Ceramics
It’s been fab working with you – we love the site and certainly going to recommend you!
James DaviesThirty Eight Degrees North
Thank you guys so much for all that you’ve done helping us to create a really awesome website!! We get such great feedback – everyone loves it & we couldn’t be prouder! Look forward to working with you again soon!
Wild Thyme PlantsWild Thyme Plants
Thanks so much for all your work on this, really appreciated. It’s come on in leaps and bounds since you took over.
Pete KewRedwood Strip Curtains

Copyright 2025 Kinetic Pulse