Filter Hook since 1.8.0
excerpt_more
Filters the '[...]' string appended to auto-generated excerpts
Description
excerpt_more only changes the trailing string on auto-generated excerpts — it does nothing to a manually written excerpt.
When it runs
Inside wp_trim_excerpt(), when WordPress builds an auto-generated excerpt.
Signature
apply_filters( 'excerpt_more', string $more_string );Parameters
$more_stringstring — String shown at the end of a trimmed excerpt.
Examples
Basic
add_filter( 'excerpt_more', function() {
return ' <a href="' . get_permalink() . '">Read more →</a>';
} );Replace the default ellipsis with a linked 'Read more' label.
Common Use Cases
- Replace the ellipsis with a Read More link
- Localize the trailing string
- Add an icon after trimmed excerpts
Common mistakes
- Calling get_permalink() outside the loop without a post ID — it can return the wrong URL on secondary queries
Related hooks
FAQ
Why doesn't excerpt_more change my manual excerpt?
It only applies to auto-generated excerpts. A manually written excerpt is used exactly as typed, with no trailing string appended.
Source: wp-includes/formatting.php