How to delete listing

Good morning :sleeping:, someone can tell me how do I delete a listing?; not just close it. Eliminate it.

Hi there!

From the UI it isn’t possible to delete a listing (only close it, which makes it invisible to users but the author and admin).

However you can, with Rails or SQL commands, mark it as deleted via the listings.deleted field. Then the listing won’t be available to anyone.

Hopefully this helps!

1 Like

Thank you very much @thomasmalbaux , that solution can work. I need to do that, because in searches, users are getting listings that are closed and it’s not clear to me why that happens.

Good to learn more! This indeed shouldn’t happen, so you should probably investigate anything related to your search indexing setup.

Hopefully this helps.

With the new installation, I’ve had no more problems. Searches work well, filters work well, too. I’ll keep an eye out for it to happen again. And what can provoke it.

1 Like

Dear @thomasmalbaux

Thanks for the tip.

In our situation, we would like to remove the listing data (including graphics) from our system entirely.

Does the ST team have a script for this?

Ideally we would like to delete all listings belong to a particular username, but if that is not possible, then userID. If that is not possible, then delete listings by listingID is acceptable too.

FYI our script to delete user is here:
https://www.sharetribe.com/community/t/best-way-to-delete-a-user/1251/11

Right now we don’t have such script ready, so you’d have to write it.

Maybe there are some parts that you can reuse in the delete_person.rb code?

Keep up the good work.

1 Like

Hey Thomas!

Sorry for the further question. I still did not understand how to delete the listing.

I still don’t know how to use the comment “listings.deleted”.

Might you give me some information?

Hi,
Actually, you can not do it from UI. You can delete a listing from Console. Or if you want to delete it from the ui, you need to customise the code and write your own function to do this.

Regards
Nadeem

Hi all,

we just switched to the self-hosted version and i’m currently doing some tests.
Is it correct, that if i’m logged in as a normal user that i can’t delete my listings?
If yes, what is of somebody makes a mistake and want to delete his post?

Thanks a lot,
reg. Sabine

Hi Sabine,

did you have a chance to browse earlier answers? They are still valid: there is no UI to delete a listing but you can either mark it as delete yourself, from your Rails Console, or write new functions to delete them entirely if that’s asked for legal reasons.

Our experience is that closing listings has been enough in the vast vast majority of cases though.