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 tried to make each one of my post excerpt's link to the full post "nofollow" like this:

<a href="<?php the_permalink() ?>" rel="nofollow">&rarr; Continue Reading</a>

However, that doesn't seem to work. I'm pretty new to WP / PHP, so what do I need to do?

share|improve this question
up vote 2 down vote accepted

In your theme's functions.php:

/* Returns a "Continue Reading" link for excerpts, with 'nofollow' set */
function your_theme_continue_reading_link() {
    return ' <a href="'. get_permalink() . '" rel="nofollow">' .
        '<span class="meta-nav">&rarr;</span> Continue reading</a>';
/* Replaces "[...]" (appended to automatically generated excerpts) */
function your_theme_auto_excerpt_more( $more ) {
    return ' &hellip;' . your_theme_continue_reading_link();
add_filter( 'excerpt_more', 'your_theme_auto_excerpt_more' );
share|improve this answer

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.