Theme & Front End PHP Beginner

Change the “Read More” Link Text

Replace "(more…)" from the More block with your own text, including the post title for screen readers.

Tested on WordPress 7.1 PHP 8.3 No plugin needed Updated
functions.php 7 lines
add_filter( 'the_content_more_link', function (): string {
	return sprintf(
		'<a class="more-link" href="%1$s">Continue reading<span class="screen-reader-text"> "%2$s"</span></a>',
		esc_url( get_permalink() . '#more-' . get_the_ID() ),
		esc_html( get_the_title() )
	);
} );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

When you split a post with the More block, archive pages show a “(more…)” link. Many identical “more” links on one page are confusing for screen reader users, who often browse a list of links. This snippet gives each one meaningful text.

How it works

The the_content_more_link filter controls the link WordPress prints in place of the More block on archive pages. The snippet builds a “Continue reading” link that jumps to the point where the post continues, with the post’s title in a visually hidden span, so screen readers hear “Continue reading Post Title”.

Things to watch

  • This affects the More block, not excerpts. For excerpt links, use the snippet that changes the excerpt length and Read more text.
  • Make sure your theme includes the .screen-reader-text class, as WordPress requires.

How to test it

Add a More block to a post and view your blog page. The link should say “Continue reading”.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only