Categories
WordPress

How to Change the WordPress Excerpt Ellipsis to Read More (or Similar)

No doubt that WordPress is perhaps the most commonly used CMS; however, despite all of its unique upgrades, functionalities, and features, there are a few default behaviors that many may not take a liking to. One of those, is the excerpt ellipsis for blog posts. Preferably, users would like to change the WordPress ellipsis to read more (or similar).

To make this adjustment (and without using any plugin), we’ll have to add some lines to the “functions.php” file. To execute, follow the instructions below.

Step by Step Instructions on Changing the Default WP Excerpt Ellipsis

Step 1: From your WP Dashboard panel on the left, head over to the “theme editor” by selecting that option under ‘Appearance.’

selecting the theme editor from appearance in wp
As shown, head over to your Theme Editor, as step 1.

Step 2: From the Theme Editor’s right panel (under the column of “theme files”), locate your functions.php file.

In step 2, find your functions.php file.

Step 3: Make a backup of your functions.php file first. Also, ensure you have systems in place that, in case you end up breaking your site, you have a way to get back in. It’s just a best practice for any time you’re tweaking PHP code.

Step 4: At the very end of your functions.php file, copy-paste the following code below:

// Changing default excerpt ellipsis to read more
function new_excerpt_more($more) {
  return ' <div><a class="read-more" href="' . get_permalink( get_the_ID() ) . '">Read More</a></div>';
}
add_filter('excerpt_more', 'new_excerpt_more');

Step 5: Hit the ‘Update File’ button for changes to take effect. If your code was inputted correctly, at this point, your ellipsis would be replaced with Read More.

ellipsis changed to read more
When the code is executed correctly, the default WP ellipsis would be changed to “Read More.”

Note that you can replace the Read More text in the code with anything you’d want.

You May Also Want to Check Out:

Conclusion

To change the WordPress excerpt ellipsis to read more (or similar), all you have to do is add a few extra code lines into your functions.php.

However, as advised before, it’s best practice to have backups of your original code, and a way for you to get back into the admin section, in the event you end up breaking the site.

Side Note: This code has only been tested on the WP Twenty Twenty theme.