In addition to the solution Mayibongwe proposed, two more possibilities.
Let's suppose you don't want filenames containing 'foobar'.
(1) Use AutoDJ + filtering rules:
* Select the DJ tab or open it with: (New Tab) -> Playlists -> Auto DJ
* Define your source tracks
* Tick 'apply filter'
* Select 'Custom Filter...' and define your filtering rule (e.g.: Filename - does not contain - foobar)
(2) Use AutoDJ + a blacklist:
* Define an auto-playlist (say: 'Blacklist') containing ONLY all the tracks you DON'T want (e.g.: Filename - contains - foobar)
* DJ tab -> define your source tracks
* Apply filter + Custom Filter...
* Rule: Playlist - is not - Blacklist
My preferred solution is (2). Advantage: you can refine your blacklist outside the DJ tab and re-use it elsewhere.