# Pulling a Blog Post Meta Description

**URL:** <https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004>\
**Category:** CMS Development\
**Created:** [January 2, 2018, 3:26pm UTC](https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004 "2018-01-02T15:26:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahein624](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ahein624/32/23640_2.png) [@ahein624](https://community.hubspot.com/u/ahein624)\
**Post date:** [January 2, 2018, 3:26pm UTC](https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004/1 "2018-01-02T15:26:13Z")

</div>

I want to pull a blog post meta descritption for a post listing module I am designing for our homepage. Does anyone know of a way to do this? Or is there a way to truncate the body content to a certain character count?

Here is the module I am building:

```auto
{% set posts = blog_recent_posts ('default', 3) %}
{% for post in posts %}
<div class="background_focus_image span4 widget-span" style="background:linear-gradient(0deg, rgba(000,000,000,0.5), rgba(000,000,000,0.5)) repeat ,url({{ post.post_list_summary_featured_image }}) no-repeat center bottom; background-size: cover;">
 <div class="homepage_title_backer">
 <h2><a href="{{ post.absolute_url }}">{{ post.name }}</a></h2>
 </div>
 <div class="homepage_desc">
 <p>{{ meta description or truncated contnet would go here }}</p>
 </div>
 <div class="homepage_CTA">
 <a href="{{ post.absolute_url }}" class="hs-button">Read More</a>
 </div>
</div>
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![edjusten](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/edjusten/32/14475_2.png) [@edjusten](https://community.hubspot.com/u/edjusten)\
**Post date:** [January 10, 2018, 9:48pm UTC](https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004/2 "2018-01-10T21:48:40Z")

</div>

Hi @ahein624 Perhaps @Jsum can provide some guidance here?

Thank you,

Ed Justen

---

<div class="post-metadata">

**Author:** ![Jlamb1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlamb1/32/82797_2.png) [@Jlamb1](https://community.hubspot.com/u/Jlamb1)\
**Post date:** [January 10, 2018, 11:37pm UTC](https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004/3 "2018-01-10T23:37:01Z")

</div>

{{ content.meta\_description }}  
is the tag to pull the meta description of a page - though if this is on the listing page it might just pull the listing page’s description.

{{ content.post\_body|truncate(25) }}  
Will allow you to pull the post body and limit to a certain number of characters. 25 can be switched out to whatever limit you want (max of 255 characters).

{{ content.post\_summary }} will print the blog post summary - this is what appears before the “read more” separator on your page.

---

<div class="post-metadata">

**Author:** ![cliffypop](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cliffypop/32/78471_2.png) [@cliffypop](https://community.hubspot.com/u/cliffypop)\
**Post date:** [January 29, 2019, 7:51pm UTC](https://community.hubspot.com/t/pulling-a-blog-post-meta-description/6004/4 "2019-01-29T19:51:17Z")

</div>

I’d love to know the if/else statement I can use to amend my blog Listing Template that will print anything entered in the Meta Description field OR use a truncated version of the body content (if nothing is entered in the Meta Description field).
