GeoDirectory SupportSQL and Bulk Deleting Images from Listings – GeoDirectory Support https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/feed Sun, 08 Feb 2026 22:32:08 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9373 <![CDATA[SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9373 Tue, 22 Jul 2014 12:45:44 +0000 jltrinka I am in a position where I need to bulk delete all images of the same name from a couple hundred gd_place listings. I plan to do this in SQL with an update statement.

All of the links to the images were imported in bulk from a CSV file linking to a single image on our server in the /uploaded/ folder, but when someone claims a listing and deletes this image from their listing, it removes the file from the server, leaving an errored image in its place in all listing profiles.

What table and row would I need to change in order to delete the IMAGE1 image for multiple listings? Is there any other recommended way to bulk delete images from listings?

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9395 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9395 Tue, 22 Jul 2014 14:05:38 +0000 Simone I believe it’s not so easy.
You should see what ID is the post/place and then match it in the geodir_attachments table, from there you’ll see the images, and the one with “1” as “menu_order” is the one you need to delete.

I’ll notify Vikas about that, maybe he’ll knows a better and easy way to do that.

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9397 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9397 Tue, 22 Jul 2014 14:27:55 +0000 jltrinka If “/2014/06/default_shops.jpg” is the name of the image i want to bulk remove, couldn’t i do something like this then?


select * from geodir_attachments where file = "/2014/06/default_shops.jpg"

UPDATE geodir_attachments
SET file = REPLACE(file, '/2014/06/default_shops.jpg', '/2014/06/')

UPDATE geodir_attachments
SET mine_type = REPLACE(mime_type, 'image/jpeg', '')

UPDATE geodir_attachments
SET mime_type = REPLACE(mime_type, 'image/jpeg', '')

UPDATE geodir_attachments
SET title = REPLACE(title, 'default_shops', NULL)
]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9399 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9399 Tue, 22 Jul 2014 14:49:06 +0000 Simone I guess something of this will work but…this isn’t bulk 🙂 this is manual since you have to manually change the file name for each place

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9405 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9405 Tue, 22 Jul 2014 15:23:51 +0000 jltrinka im not sure i follow, wouldnt these queries recursively clear out the entries?

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9406 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9406 Tue, 22 Jul 2014 15:26:36 +0000 Simone I tried to update only the attachment table and it works. What I meant is that you need to do that file by file not “bulk”

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9411 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9411 Tue, 22 Jul 2014 15:35:30 +0000 jltrinka Well, there is only one image file that I am trying to remove from many listings.

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9412 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9412 Tue, 22 Jul 2014 15:40:56 +0000 Simone Oh sorry I thought you had multiple listings with different images, you’re good to go then

]]>
https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9683 <![CDATA[Reply To: SQL and Bulk Deleting Images from Listings]]> https://wpgeodirectory.com/support/topic/hiding-the-map-on-mobile/#post-9683 Wed, 23 Jul 2014 21:27:39 +0000 jltrinka Okay, so I made a post earlier today about an issue I think is related to this:

https://wpgeodirectory.com/support/topic/default-listing-image-not-displaying/

I think the images are linked somewhere else in SQL making GD think there are still images and not show the default image set in the Place Categories section. I really desperately need to find a solution to this. Can you guys please help with this?

]]>