Jump to content

How to remove pictures of deleted products


Recommended Posts

Hello,

I face to lack of space on server and the database makes bigger with my shop, I've searched for a long time but still don't get answer. I hope Prestashop team, who builds this platform or other experts will have a solution.

 

My shop is running for some years and I have many out of stock products (I don't provide stock management). For example I want to massive delete products which have id from 1000-3000 and all their images in /img and their records in database.

 

Thank you very much

Rakepl

 

Link to comment
Share on other sites

I didn't test it, but if you run a script like $product->delete(); it should  get rid of images ($product must be a valid product instance)

 

Try with one first, manually adding the id, see if it works. If it does, create a script and run a query to grab all product ids in the range, then for each of them, create a new product instance and use delete()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...