# Tag conversion without kirbytext

**URL:** <https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895>\
**Category:** Questions\
**Tags:** v2\
**Created:** [November 29, 2016, 1:54pm UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895 "2016-11-29T13:54:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![timoetting](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/timoetting/32/781_2.png) [@timoetting](https://forum.getkirby.com/u/timoetting)\
**Post date:** [November 29, 2016, 1:54pm UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895/1 "2016-11-29T13:54:16Z")

</div>

Hey,

is there a way to convert a custom kirbytag of a text field without using the kirbytext/markdown method? I would like to avoid the p tags that would otherwise be added to my text.

As pointed out in [Is it possibble to parse kirbytext tags without markdown?](https://forum.getkirby.com/t/is-it-possibble-to-parse-kirbytext-tags-without-markdown/1328) one way would be to disable makedown in the config. However this would not work for me because I still need markdown conversion on other texts.

Thanks,  
Tim

---

<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:** [November 29, 2016, 2:12pm UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895/2 "2016-11-29T14:12:44Z")

</div>

You can use a function that filters them out:

```auto
function ktRaw($content) {
  $text = kirbytext($content);
  return preg_replace('/(.*)<\/p>/', '$1', preg_replace('/<p>(.*)/', '$1', $text));
}

```

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [November 29, 2016, 2:18pm UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895/3 "2016-11-29T14:18:18Z")

</div>

If you only need one Kirbytag per field, you could also use the [`kirbytag()` helper](https://getkirby.com/docs/cheatsheet/helpers/kirbytag).

---

<div class="post-metadata">

**Author:** ![timoetting](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/timoetting/32/781_2.png) [@timoetting](https://forum.getkirby.com/u/timoetting)\
**Post date:** [March 2, 2017, 12:29am UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895/4 "2017-03-02T00:29:13Z")

</div>

Hey all together!

I created the custom field method `$field->convertKirbytags()` that gives me what I need. You can find it on [github](https://github.com/TimOetting/convertKirbytags).

---

<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, 4:52pm UTC](https://forum.getkirby.com/t/tag-conversion-without-kirbytext/5895/6 "2025-02-06T16:52:33Z")

</div>

Archived on February 6, 2025, 4:52pm UTC


