# Changing excerpt length

**URL:** https://meta.discourse.org/t/changing-excerpt-length/154643
**Category:** Support
**Created:** [June 12, 2020, 9:01am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643 "2020-06-12T09:01:18Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 9:01am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/1 "2020-06-12T09:01:18Z")

</div>

It’s very nice! Can I somehow limit the number of characters in an excerpt?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [June 12, 2020, 9:08am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/2 "2020-06-12T09:08:31Z")

</div>

There is a site setting in discourse `topic_excerpt_maxlength `. IIRC this will only apply to new topics - if you want to apply the change to existing topics you will need to ‘rebake’ them.

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 9:10am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/3 "2020-06-12T09:10:57Z")

</div>

> [@david](#):
>
> There is a site setting in discourse `topic_excerpt_maxlength ` . IIRC this will only apply to new topics - if you want to apply the change to existing topics you will need to ‘rebake’ them.

Thanks, How i can ‘rebake’ them?

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 9:28am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/4 "2020-06-12T09:28:05Z")

</div>

This command don’t help me:

```
$ cd /var/discourse
$ ./launcher enter app
$ rake posts:rebake

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [June 12, 2020, 9:35am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/5 "2020-06-12T09:35:54Z")

</div>

> [@Varhall](#):
>
> don’t help me:

What happened? Did it show an error?

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 9:37am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/6 "2020-06-12T09:37:04Z")

</div>

Change in site settings:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/1/d1bd493085307df7891fb8fc1636315bb3a282da.png)

No erros:

```
# cd /var/discourse
# ./launcher enter app
# rake posts:rebake
Rebaking post markdown for 'default'
     4805 / 4805 (100.0%)
4805 posts done!

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [June 12, 2020, 9:45am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/7 "2020-06-12T09:45:09Z")

</div>

And the excerpts are still more than 100 characters? Is the change working for new topics?

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 10:03am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/8 "2020-06-12T10:03:37Z")

</div>

More 100 characters now, but in settings 100:

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/e/3e8930a9920f6aede64bef7e459d184555c5b6a4.png)

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 12, 2020, 10:21am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/9 "2020-06-12T10:21:11Z")

</div>

Don’t working for new topics too

---

<div class="post-metadata">

### Author: ![Varhall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/varhall/32/174181_2.png) [@Varhall](https://meta.discourse.org/u/Varhall)
#### Post date: [June 14, 2020, 11:14am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/10 "2020-06-14T11:14:59Z")

</div>

How to solve this problem? Any ideas?

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [November 25, 2020, 11:24pm UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/11 "2020-11-25T23:24:43Z")

</div>

Is this the right setting? I noticed my excerpts are as long as 300 characters, which is the default setting for `post excerpt maxlength`.

---

<div class="post-metadata">

### Author: ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)
#### Post date: [March 11, 2021, 6:39pm UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/12 "2021-03-11T18:39:54Z")

</div>

I have not been able to get this change to work.

I am looking to change the length of the preview excerpt when someone on my forum pastes a link to another topic on my forum. Basically, the length of this (only for posts within my forum):

> [@Discourse Subscriptions Plugin](https://meta.discourse.org/t/discourse-subscriptions/140818):
>
> discourse2Summary The Discourse Subscriptions plugin allows site owners to sell recurring and one-time purchase subscriptions that grant access to a group on a Discourse instance.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. The Discourse Subscriptions plugin allows you to create one-time as well as recurring subscriptions that users can pay for in order to access gated content. This can be a great w…

Right now, the preview is very long (400 characters). I have tried changing both the “post\_excerpt\_maxlength” setting, as well as the “topic\_excerpt\_maxlength” setting. Neither made a difference for this–including for new topics created after the setting was changed.

How can I adjust this setting to make the previews shorter when I link to another post on my forum?

---

<div class="post-metadata">

### Author: ![Jeroen\_Van\_Der\_Mark](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeroen_van_der_mark/32/81687_2.png) [@Jeroen\_Van\_Der\_Mark](https://meta.discourse.org/u/Jeroen_Van_Der_Mark)
#### Post date: [November 15, 2022, 4:49am UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/13 "2022-11-15T04:49:27Z")

</div>

Same problem here. Is this already fixed for old topics? 🙂

I can’t get it working: [https://forum.fit.nl/](https://forum.fit.nl/)

I want to limit the excerpt length to 20 words for example.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [November 17, 2022, 9:07pm UTC](https://meta.discourse.org/t/changing-excerpt-length/154643/14 "2022-11-17T21:07:12Z")

</div>

I think that you need to rebake the posts in order for those settings to apply to older ones.
