Post Pic

How to: Remove the [...] from the excerpt

Did you ever wondered why the the_excerpt() function always display [...] at the end of the post excerpt? To be honest, I don’t find this very beautiful. So, what about remove it? Just read on.

To get rid of the [...] at the end of the post excerpt, simply paste the following function in the functions.php file from your theme:

function trim_excerpt($text) {
  return rtrim($text,'[...]');
}
add_filter('get_the_excerpt', 'trim_excerpt');

And you're done! Goodbye [...] :)

By the way, I recently started a contest on Cats Who Code, where you can win premium WordPress themes. Sounds good to you? Click here to join.

4 Responses

Apr 29 2012 00:34

If i paste the above code in the functions.php its not removing [...] excerpt, still i can see the excerpt on home page can you please help me on this

Sep 05 2012 15:06

This code is not working for me :(

Dec 12 2012 19:26

Not really working :(

Feb 25 2013 05:15

Works Great Thanks for the quick tip :)

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox