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_string string — 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

Group wizard

One session: this hook, then each related_hooks entry. Walk it and tell us what to change.

excerpt_more → excerpt_length → the_excerpt

functions.php — excerpt_more
functions.php
PHP excerpt_more · Hook 1 of 3 · Step 1 of 6

Practice the excerpt_more WordPress filter hook in our interactive sandbox — a VS Code-style editor with a step-by-step excerpt_more tutorial, add_filter exercises, and instant feedback. No local WordPress install required.