Jump to content

Exclude files from search

Recommended Posts

Hi, how can I exclude files from Alfred search.

For example, I used the keyword "heat map" and have been launching "2021 heat map.xls" whole of last year. This year, I have a "2022 heat map.xls" file but typing "heat map" always launch the 2021 version. I'd like to exclude it from the search result.


Secondly, the search result will show "~$2021 heat map.xls". I believe these are Microsoft Excel temporary files that is somehow picked up by Alfred. I want to remove this from the search too. 


Appreciate any help rendered.

Link to comment
2 hours ago, Belfong said:

It also seems I can’t exclude Folders from being search. I could have sworn I’ve seen this before. 

You can use a file filter input to do that. From the page to which I have linked:



A file filter allows you to narrow down your search to particular file types you want to find, making it easier to locate the file you need.

Rather than add every possible file type to your default Alfred results, or trawl through an unfiltered list of all files that match your search term, these finely focused filters will help you find the results you need in a moment.



As an alternative, if you run your search a few times and always select the file you need (i.e., the 2022 file) Alfred will remember that and soon it will appear top of your search results.


No doubt there are other ways to achieve what you need but these are the first that occurred to me. I hope they help.



Link to comment
52 minutes ago, Stephen_C said:

As an alternative, if you run your search a few times and always select the file you need (i.e., the 2022 file) Alfred will remember that and soon it will appear top of your search results.

Thanks Stephen. I searched the knowledge base and saw this article which also explains how to reset the keyword latching. So this helps. Appreciate it.



I still think having ability to exclude folder from search is useful. For example, I have Documents which have tons of folders including Temp which I use to dump stuff I am not sure what to do with. It would be useful to be able to exclude Temp. The file filtering would means i have to include every sub folder in Documents. Anyway, I have moved Temp to home folder to 'exclude' it.

Link to comment

You might take a look at the example workflow included and called Dynamic File Search. Go to Workflows, click the plus button at the bottom of the list and choose Examples to find it. (Sorry if you've already seen it!)



Link to comment
11 hours ago, vitor said:

Removing node_modules files from Alfred’s results explains the trouble (and alternatives) with excluding directories. Long story short (but check the page, it’s short too): the macOS metadata search API is the blocker. As for files, adding a alfred:ignore Spotlight comment to the file will make it not show.

Thanks! Spotlight Privacy is what I am looking for. I can add folders there to exclude them. No problem. It's just that I don't do this often and after a few month/years, I have forgotten about this option. What would be useful is if Alfred add a note in the Preference to point to this tip, maybe?


Regarding the node_modules files page which you linked, one of the 3rd bullet says:

  • You could remove the whole node projects folder from Alfred's search scope

It does seems to imply that we can exclude folder, although I now know it can't, so there is a disjoint there.


Link to comment

Just released Ignore in Alfred, a Workflow to do this faster and more conveniently. It uses a new Automation Task to tag (or remove the tag from) the files and folder trees you want to ignore with alfred:ignore.


Note that when you ignore a whole directory tree, you’re ignoring the folder and each file individually. If you move a file outside the folder, it will continue to be ignored. If you move a new file into it, it won’t be ignored. This is when you’ll use reignore in the Workflow, to easily reapply the label to a folder’s contents. With unignore, you’ll be able to search only previously ignored files and folders.


Edited by vitor
Link to comment

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...