B
B
Black_Fire2021-10-03 18:53:35
SQL
Black_Fire, 2021-10-03 18:53:35

Is it possible to delete a certain list of products along with images from an online store on Wordpress via SQL?

Is it possible, among the many existing products on the site, to identify a specific set and delete it along with the images used in each product?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexalexes, 2021-10-03
@alexalexes

Can. If the image files are stored in the server's file system, then make a request that gets the ftp paths to each file, by the id of a particular product. Then you make a query-selection for the id of the goods that you want to remove.
1. Run a query that receives a selection of product ids.
2. Select one query string from step 1.
3. Run a query that receives a selection of ftp image paths.
4. Get one line from the request of step 3.
5. Delete the file from the server's file system.
6. Go to step 4 until the selection of images ends.
7. We mark the product as deleted (update request).
8. Go to step 2 until the selection of items to delete is over.
End.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question