WordPress

How to Add a Read More Link to Manual Excerpts

If you want to add a 'read more' link to your manual excerpts, here's how to do it. I tested this code with a child theme fromĀ GenesisĀ but it should work for all themes.
Table of Contents

If you purchase through a link on our site, we may earn a commission.

If you want to add a ‘read more’ link to your manual excerpts, here’s how to do it.

//* Changing excerpt more - only works where excerpt IS hand-crafted
function manual_excerpt_more( $excerpt ) {
	$excerpt_more = '';
	if( has_excerpt() ) {
    	$excerpt_more = '&nbsp;<a href="' . get_permalink() . '" rel="nofollow">[Read more]</a>';
	}
	return $excerpt . $excerpt_more;
}
add_filter( 'get_the_excerpt', 'manual_excerpt_more' );

I tested this code with a child theme from Genesis but it should work for all themes.

If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.

Jean Galea is an investor, entrepreneur, and writer. He is the founder of WP Mayor, and the plugins WP RSS Aggregator and Spotlight. He also runs the Good Life Collective. Connect with him on X or visit jeangalea.com.

If you purchase through a link on our site, we may earn a commission.

6 Responses

  1. Hi! Thank you very much!
    May be you know how to make that my custom more link showing in same paragraph. Now it looks like that:

    (paragraph tag open)
    here manual excerpt text
    (paragraph tag close)
    (paragraph tag open)
    here my custom more link
    (paragraph tag close)

    I want to display more link inline at the end of excerpt text, after last letter.

  2. The manually created excerpts don’t have anything like “read more” in the RSS feed. The posts have the link on the main page. When I look in the RSS feed, I can see that the automatically generated excerpts have […] at the end. Do you know how to add something to those manually created excerpts in the RSS feed?

Latest Articles from the Blog

Stay updated with WP Mayor's newsletter.

Discover the best and latest tools and services in WordPress every month.