# How to change the Read More link in WordPress

URL: https://wp24x7.com/how-to-change-the-read-more-link/
Updated: 2026-11-29
Type: blog post
Audience: WordPress site owners and theme developers

> A how-to for changing the Read More text and link in WordPress. It explains the two sources of Read More, automatic excerpts and the More tag, and gives filter code for each, for manual excerpts and for excerpt length. Block themes can do the same in the Site Editor with no code. It also covers accessibility and common mistakes.

## Key facts

- For: site owners and theme developers
- Automatic excerpts: the excerpt_more filter
- More tag: the the_content_more_link filter
- Block themes: Post Excerpt and Read More blocks, no code
- Where to put code: a child theme or small plugin, after a backup
- Default excerpt length: 55 words

"Read more" appears in two different ways in WordPress, and they are changed by two different hooks. **Use `excerpt_more` for automatic excerpts and `the_content_more_link` for the More tag, or the Site Editor blocks if your theme supports them.**

> **Quick answer**
Classic theme with automatic excerpts: filter `excerpt_more`. Editors using the More tag: filter `the_content_more_link`. Block theme: edit the Post Excerpt and Read More blocks in Appearance, Editor. Put code in a child theme or small plugin, after a backup.

## Where does Read More come from?

| Source | What WordPress does | Hook that changes it |
|:--|:--|:--|
| Excerpt | `the_excerpt()` trims the post to a set number of words and adds `[…]` | `excerpt_more` |
| More tag | The More block (or `<!--more-->`) shows content up to that point, then a link | `the_content_more_link` |
| Manual excerpt | Shown exactly as written, no ending added | `get_the_excerpt` or the template |

A theme can also draw its own button after either, so check what yours does before changing anything.

## How do I change the excerpt ending or the More link?

### Excerpt ending
In a child theme or small plugin, after a backup:

```php
add_filter( 'excerpt_more', function () {
	return sprintf(
		' &hellip; <a class="read-more" href="%s">%s</a>',
		esc_url( get_permalink() ),
		esc_html__( 'Continue reading', 'my-site' )
	);
} );
```

This replaces `[…]` with an ellipsis and a link. If you only want to remove the text, return an empty string or just `&hellip;`. A **manually written excerpt** is shown exactly as written, so add your link in the template. The word count of automatic excerpts is controlled by the `excerpt_length` filter, and some themes use their own excerpt function and ignore this filter.
### More tag link
```php
add_filter( 'the_content_more_link', function () {
	return sprintf(
		' <a class="more-link" href="%s">%s<span class="screen-reader-text"> %s</span></a>',
		esc_url( get_permalink() ),
		esc_html__( 'Continue reading', 'my-site' ),
		esc_html( get_the_title() )
	);
} );
```

Notice the hidden title text. Many "Read more" links on one page sound identical to screen reader users, who often browse a list of links. Adding the title makes each link meaningful.
### Block theme, no code
In **Appearance, Editor**, open the template that lists posts, such as Blog Home or Archive:

- A **Post Excerpt** block has its own settings for excerpt length and for how the "more" text appears. Option names vary a little between WordPress versions, so look in the block settings sidebar.
- A **Read More** block shows a link to the post. Its text is editable, and you can style it like a button.

Block theme changes are saved in the database against the theme. See the notes on switching themes in [setting up a child theme](/how-to-properly-set-up-child-theme).

## What did the old advice get wrong?

Older tips told you to edit `index.php` in the dashboard's theme editor and change the call to `the_content()`. Three problems:

- A theme update overwrites the edit.
- A typo in the dashboard editor can take the site down with no undo. You can switch the editor off with `DISALLOW_FILE_EDIT`, covered in our [file manager plugin warning](/avoid-file-manager-plugin-critical-security-flaw).
- The `the_content()` function takes a link text argument, but passing other values as in old guides gives unexpected results.

Filters are the right tool, because they work in every theme and survive updates.

## How do I give a manual excerpt a link too?

Since manual excerpts skip `excerpt_more`, append the link yourself when the editor wrote an excerpt:

```php
add_filter( 'get_the_excerpt', function ( $excerpt, $post ) {
	if ( is_admin() || ! has_excerpt( $post ) ) {
		return $excerpt;
	}
	return $excerpt . sprintf(
		' <a class="read-more" href="%s">%s</a>',
		esc_url( get_permalink( $post ) ),
		esc_html__( 'Continue reading', 'my-site' )
	);
}, 10, 2 );
```

Automatic excerpts are left to `excerpt_more`, so you do not get two links. If your theme prints its own button after the excerpt, use only one of the approaches.

## How do I change the excerpt length?

```php
add_filter( 'excerpt_length', function () {
	return 30; // words
}, 999 );
```

A high priority number makes it run after a theme's own setting. Block themes control length in the Post Excerpt block instead.

## Which approach should I choose?

| Situation | Best choice |
|:--|:--|
| Classic theme, automatic excerpts | `excerpt_more` filter |
| Editors use the More tag | `the_content_more_link` filter |
| Editors write excerpts by hand | `get_the_excerpt` filter or edit the template |
| Block theme | Site Editor blocks, no code |
| Theme draws its own button | Change the theme template in a child theme |

## How do I make links accessible and trackable?

- Include the post title in the link, visibly or with a screen-reader-only span.
- Use a real link, not a button with JavaScript, so it works for everyone and search engines can follow it.
- If you track clicks in analytics, give the link a class and trigger the event on that class.
- Keep the text short and honest: "Continue reading" or "Read the guide" is better than "Click here".

## How do I check it?

1. **Create a test post.** Make it longer than the excerpt length, without a manual excerpt.
2. **Open your blog page.** Check the ending and its link.
3. **Test the More tag.** Add a More block in another post and check that list page.
4. **Test a manual excerpt.** See what your theme does there.
5. **Check other lists.** Search results and category pages often use the excerpt as well.

## A common scenario

Suppose a magazine site shows cards with an image, title and excerpt, and the designer wants a "Read the story" link after each. The cards use automatic excerpts for most posts, but editors write a hand excerpt for features. If you only use `excerpt_more`, the features have no link and look inconsistent. The cleaner fix is to put the link in the card template once, outside the excerpt, so it appears on every card whichever way the excerpt was made, and to leave both filters alone.

## Common mistakes

> **Check these first**
Adding the filter to the parent theme, where an update removes it. Returning the link without `esc_url()` and `esc_html()`. Giving every link the same text with no title. Hunting for the setting when your theme draws the button itself. Forgetting to clear a page cache, then concluding it did not work.

- **Theme development** Card layouts and custom Read More behavior. [WordPress theme development](/wordpress-theme-development)
- **Custom development** Hooks, filters and small plugins. [WordPress development](/wordpress-development)
- **Child themes** Where the code should live. [Set up a child theme](/how-to-properly-set-up-child-theme)

**Need a custom blog layout?**
A developer reads your brief, today.
[Post a project](/post-project)
[Call the help desk](/help-desk)

## Frequently asked questions

### Why does my excerpt not show the Read More text?

A manually written excerpt does not get the excerpt_more text added. The filter only applies to automatically trimmed excerpts.

### What is the difference between excerpt_more and the_content_more_link?

excerpt_more changes the text after an automatic excerpt. the_content_more_link changes the link created by the More tag in the editor.

### Can I do this without code?

In a block theme, yes. The Read More block and the Post Excerpt block both have text settings in the Site Editor.

### How do I make a manual excerpt end with a link?

Add a get_the_excerpt filter that appends the link when has_excerpt() is true. Manual excerpts never get the excerpt_more ending, so the link has to be added another way.

### Can I change how long automatic excerpts are?

Yes, with the excerpt_length filter, which returns a number of words. The default is 55 words.

### Why is editing index.php in the theme editor a bad idea?

A theme update overwrites the edit, and a typo in the dashboard editor can take the site down with no undo. Filters in a child theme or plugin work in every theme and survive updates.

### Why does my filter change nothing?

Some themes use their own excerpt function or draw their own button, so the filter never runs. Check the theme template, and clear any page cache after changing the code.

### How do I make Read More links accessible?

Include the post title in the link, visibly or in a screen-reader-only span, so a list of links is not a column of identical Read more entries. Use a real link rather than a script button.

### Where should the filter code live?

In a child theme or a small plugin, never the parent theme where an update removes it. Take a backup before changing a live site.

### How do I stop two Read More links appearing?

Use only one approach. If your theme prints its own button after the excerpt, change that template instead of also filtering excerpt_more, or the reader sees two links.

### Do search and category pages use the same excerpt?

Often yes. Test search results and category pages as well as the blog page after the change, since many themes reuse the excerpt template there.

### Can WP24x7 build custom card layouts with a Read More link?

Yes. Card layouts with custom Read More behavior are theme work. Post a project and a developer will tell you what is involved.
