WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use two custom functions for my excerpts, the first modifies the length of the excerpt and the second allows me to use the_excerpt in two ways - with a read more link and without as long as the appropriate code is included while calling the_excerpt (see here).

When I use the traditional the_excerpt it generates three ellipses in brackets after it [...] - how do I remove these brackets and ellipses to just display the_excerpt itself without any link when calling it in posts, but still using my code below for the read more link elsewhere?

// Excerpt
    // Changing excerpt length
    function new_excerpt_length($length) {
        return 25;
    add_filter('excerpt_length', 'new_excerpt_length');

    // Changing excerpt more
    function new_excerpt_more($post) {
      remove_filter('excerpt_more', 'new_excerpt_more'); 
      return ' <a class="read_more" href="'. get_permalink($post->ID) . '">' . 'read more' . '</a>';
share|improve this question
up vote 6 down vote accepted

You haven't added the second filter, at least not in the code posted. If used, that filter will not print ellipses.

// Changing excerpt more
function new_excerpt_more($more) {
  global $post;
  remove_filter('excerpt_more', 'new_excerpt_more'); 
  return ' <a class="read_more" href="'. get_permalink($post->ID) . '">' . 'read more' . '</a>';

Notice the couple of changes I made to that function.

If you just want to strip the ellipses:

share|improve this answer
I had to remove Line 2 of the function, otherwise it only replaced the first [...] and then printed them for all posts after. – rob-gordon Mar 24 '15 at 23:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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