I want to remove the "Continue Reading" link from the teaser excerpt only and not from the automatic excerpt, which filter is easily available.

This is the original code; it's from the Showcase Template Page Template:

    <?php while ( have_posts() ) : the_post(); ?>

    if ( '' != get_the_content() )
        get_template_part( 'content', 'intro' );

<?php endwhile; ?>

Here is the Intro:

<div class="entry-content">
    <?php the_content(); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mytheme' ) . '</span>', 'after' => '</div>' ) ); ?>
    <?php edit_post_link( __( 'Edit', 'mytheme' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->


  • We need to see all of your code, could you post the contents of content-intro.php? Might want to look up what get_template_part does =p – Tom J Nowell Jan 25 '13 at 23:07

Change standard text for all excerpts:

function custom_excerpt_more($more) {
   global $post;
   $more_text = '...';
   return '… <a href="'. get_permalink($post->ID) . '">' . $more_text . '</a>';
add_filter('excerpt_more', 'custom_excerpt_more');

Create your own excerpt function:

// Rafael Marques Excerpt Function ;)
function rm_excerpt($limit = null, $separator = null) {

    // Set standard words limit
    if (is_null($limit)){
        $excerpt = explode(' ', get_the_excerpt(), '15');
    } else {
        $excerpt = explode(' ', get_the_excerpt(), $limit);

    // Set standard separator
    if (is_null($separator)){
        $separator = '...';

    // Excerpt Generator
    if (count($excerpt)>=$limit) {
        $excerpt = implode(" ",$excerpt).$separator;
    } else {
        $excerpt = implode(" ",$excerpt);
    $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
    echo $excerpt;

Use <?php rm_excerpt(); ?> when you want display custom excerpt. First value set words limit and second value set separator. Example: <?php rm_excerpt(10,' (...)'); ?>. To create separate link "read more", insert <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More?</a>

  • Okay, so there is no specific filter that modifies the teaser only? – Marcus Jan 25 '13 at 22:01
add_filter( 'the_content_more_link', 'wpsites_read_more_link' );
function wpsites_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '"></a>';

Add this to your functions file and it will remove the more link.



It sounds like you want to remove the "Continue Reading" teaser from the_content(). If so, this example from the Codex would be what you need:

Read More Techniques

The parameters within the template tag the_content() are as follows:

<?php the_content( $more_link_text , $strip_teaser ); ?>

The $more_link_text sets the link text like "Read More". The second one, $strip_teaser, sets whether or not the "more" link should be hidden (TRUE) or displayed (FALSE). The default is FALSE, which shows the link text.

To remove the teaser:

Change the_content(); in your index.php to (i.e., the second parameter controls this):


Include <!--noteaser--> in the post text, immediately after the <!--more-->.

Based on your code, it looks like you have added the code in the wrong place. Without seeing your files, you probably need to go to content.php and look for the_content() and make the change there. I checked it on one of my themes that uses templates and it works fine. You should also read up more on templates, so you understand how they function. In short:

1 - Remove this text from your code: if ( '' != get_the_content('',TRUE,'') )
2 - Go to content.php in your theme and find the_content() and change it to the_content('',TRUE,'')
3 - Add <!--noteaser--> as indicated above

This is if you are using <!--more--> to manually setup the excerpts.

  • Hi chowwy -- I saw that and assumed that it removes the teaser altogether instead of just removing the Continue Reading link. Is this not correct? – Marcus Jan 25 '13 at 22:04
  • It looks like $strip_teaser indicates whether the "more" link should be hidden/shown. Doesn't indicate that the excerpt itself is removed. – chowwy Jan 25 '13 at 22:05
  • chowwy -- doesn't work. Notice that it says to put the <!--noteaser--> tag after the more tag, which does not apply to teaser excerpts because they don't have more tags. Does this make sense? I tried inserted the <!--noteaser--> in the editor anyway and got nothing. – Marcus Jan 25 '13 at 22:17
  • Marcus, do you have some code we can see? Is this in the loop as the_content() or are you using the_excerpt() somewhere else? – chowwy Jan 25 '13 at 22:21
  • I just put it in the question – Marcus Jan 25 '13 at 22:30
//.... get_the_content() .....//

Just edit this part like this: get_the_content("")

With this "" you will make content empty. So just you would have your content text without read more link :-)


I had to go into the wp-includes folder, inside the formatting.php file and edit line 3284 and change the default number of words to include in the excerpt to a huge number like so:

    $excerpt_length = apply_filters( 'excerpt_length', 550000000000000 );

The default is only 55

  • You should avoid editing core files like formatting.php if at all possible, because they will continue to change when you upgrade. Instead use the excerpt_length filter to change the value. – Marcus Downing Jul 26 '17 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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