# Search content, in a page and get the field back?

**URL:** <https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376>\
**Category:** Questions\
**Tags:** v2\
**Created:** [May 9, 2018, 9:17am UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376 "2018-05-09T09:17:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benni-t](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@benni-t](https://forum.getkirby.com/u/benni-t)\
**Post date:** [May 9, 2018, 9:17am UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376/1 "2018-05-09T09:17:26Z")

</div>

Hello guys,

i want to search a string in the whole content of a specified page. Is it possible to get the field back where the string is saved?

Thanks,  
Benni

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 9, 2018, 9:23am UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376/2 "2018-05-09T09:23:33Z")

</div>

The default search function only returns a collection of pages, so the answer is no. You would have to create your own search method to achieve that.

---

<div class="post-metadata">

**Author:** ![benni-t](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@benni-t](https://forum.getkirby.com/u/benni-t)\
**Post date:** [May 9, 2018, 9:26am UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376/3 "2018-05-09T09:26:51Z")

</div>

Okay, thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 9, 2018, 11:35am UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376/4 "2018-05-09T11:35:34Z")

</div>

Depending on your use case, you could let the standard search function return the results collection. And then for each result, search for the string in all fields and return an array of fields with that search term.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:28pm UTC](https://forum.getkirby.com/t/search-content-in-a-page-and-get-the-field-back/10376/5 "2025-02-06T17:28:18Z")

</div>


