I am displaying the wordpress posts on the index page with:

<?php the_excerpt(); ?>

In my functions.php file I have following code:

add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 30; }

This works fine but it shows [...] at the end of excerpt. I want to remove these [ and ] and instead I want to show only three dots ... . How can i do that? Thanks.

1 Answer 1


Use the excerpt_more filter hook:

function mytheme_excerpt_more( $text ) {
    $text = '...';
    return $text;
add_filter( 'excerpt_more', 'mytheme_excerpt_more' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.