Searching for deleted topics with a keyword in title

How do I search for a deleted post that has a specific keyword in the title?

Adding ?status=deleted to the basic search URL doesn’t seem to work.

I don’t think there is any way to do this through the Discourse search page. I can see how having a filter to search for deleted posts could be useful for site admins though.

Data Explorer queries can be used to return deleted topics and posts. Something like the query below could help:

--[params]
-- string :term

SELECT
id AS topic_id
FROM topics
WHERE deleted_at IS NOT NULL
AND title LIKE CONCAT('%', :term, '%')

For site’s on our hosting, you can also contact our support team and we’ll find the topic for you.

3 Likes

:slightly_smiling_face:

Thanks for the reply. Our mods are not familiar with Data Explorer. For now, we can do a search for all deleted posts (/latest?status=deleted) and do a page search for the word. If it’s fairly recent we’ll find it that way. Otherwise, we can ask you all for help.

Can we consider this a (low priority) request to have a deleted filter eventually added to the search pane for staff?

For moderators to use the query you’d need to add the query and then give your site’s moderators access to it. We can help you set that up through our private support if it’s something you’d like to try in the future.

For sure. There may be a technical reason for why that hasn’t already been implemented, but there have been a few times where I’ve needed to search for deleted topics and posts.

1 Like

@sam is opposed to it as it could bloat full text index, and I tend to agree it’s not that useful of a feature.

1 Like