# Display blog post snippet

**URL:** <https://community.hubspot.com/t/display-blog-post-snippet/9740>\
**Category:** CMS Development\
**Created:** [August 7, 2018, 8:10am UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740 "2018-08-07T08:10:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![david\_eic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/david_eic/32/6864_2.png) [@david\_eic](https://community.hubspot.com/u/david_eic)\
**Post date:** [August 7, 2018, 8:10am UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/1 "2018-08-07T08:10:50Z")

</div>

Hi,

I’m currently building a blog template that outputs a couple of lines preview text on the listing page.

At the minute I’m using the {{ content.post\_list\_content }} hubl tag to display the preview text but it pulls through html like \<a\> tags and \<video\> elements which should be stripped out.

Does anyone know the best way to pull the preview text into a blog template as text and strip out the html?

Thanks for your help!

David

---

<div class="post-metadata">

**Author:** ![JasonRosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jasonrosa/32/56551_2.png) [@JasonRosa](https://community.hubspot.com/u/JasonRosa)\
**Post date:** [August 7, 2018, 10:39am UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/2 "2018-08-07T10:39:59Z")

</div>

Hey [@david\_eic](https://community.hubspot.com/t5/user/viewprofilepage/user-id/67318) you can accomplish this by using the striptags HubL filter which is [documented here](https://designers.hubspot.com/docs/hubl/hubl-supported-filters#striptags). Your code would look something like this:

\<p\>{{ content.post\_list\_content|striptags }}\</p\>

Let me know if you have any questions about this!

---

<div class="post-metadata">

**Author:** ![madraxsam](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/madraxsam/32/47092_2.png) [@madraxsam](https://community.hubspot.com/u/madraxsam)\
**Post date:** [January 5, 2021, 4:37pm UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/3 "2021-01-05T16:37:32Z")

</div>

I’m having a similar issue on my blog listing page ([Bike Security Blog | Madrax](https://blog.madrax.com/blog)) with HubSpot Videos. Where in the preview text it’s bringing in the video code:

{% video\_player “embed\_player” overrideable=False, type=‘scriptV4’, hide\_playlist=True, viral\_sharing=False, embed\_button=False, autoplay=False, hidden\_controls=False, loop=False,…

This is what is in my blog listing code:

\<p\>{{ content.post\_list\_content|safe|truncatehtml(190 )|striptags }}\</p\>

Any idea how to keep that video code from showing up?

---

<div class="post-metadata">

**Author:** ![madraxsam](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/madraxsam/32/47092_2.png) [@madraxsam](https://community.hubspot.com/u/madraxsam)\
**Post date:** [January 5, 2021, 4:44pm UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/4 "2021-01-05T16:44:24Z")

</div>

Figured it out, the striptags needs to be before the truncatehtml in the code.

---

<div class="post-metadata">

**Author:** ![BManandhar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bmanandhar/32/31184_2.png) [@BManandhar](https://community.hubspot.com/u/BManandhar)\
**Post date:** [June 7, 2022, 1:15am UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/5 "2022-06-07T01:15:26Z")

</div>

Hi there, how do I pull all the tags without strip it one?

---

<div class="post-metadata">

**Author:** ![Techclaro](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/techclaro/32/38102_2.png) [@Techclaro](https://community.hubspot.com/u/Techclaro)\
**Post date:** [January 17, 2024, 9:04am UTC](https://community.hubspot.com/t/display-blog-post-snippet/9740/6 "2024-01-17T09:04:40Z")

</div>

## striptags

Strip SGML/XML tags and replace adjacent whitespace by one space. This filter can be used to remove any HTML tags from a variable.

## safe

Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped.

**{{ topic\_post.post\_list\_content|safe|striptags }}**
