# Filter to exclude files that contain specific string in their name

**URL:** <https://forum.getkirby.com/t/filter-to-exclude-files-that-contain-specific-string-in-their-name/573>\
**Category:** Questions\
**Tags:** v2\
**Created:** [March 23, 2015, 1:54pm UTC](https://forum.getkirby.com/t/filter-to-exclude-files-that-contain-specific-string-in-their-name/573 "2015-03-23T13:54:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)\
**Post date:** [March 23, 2015, 2:16pm UTC](https://forum.getkirby.com/t/filter-to-exclude-files-that-contain-specific-string-in-their-name/573/4 "2015-03-23T14:16:31Z")

</div>

I’d rather create my own filter here:

```php
$page->images()->filter(function($image) {
  return !str::contains($image->filename(), 'cover');
});

```

---

_[View the full topic](https://forum.getkirby.com/t/filter-to-exclude-files-that-contain-specific-string-in-their-name/573)._
