How To: Remove ‘Continue Reading’ from Excerpts – WordPress

Woooah didn’t notice times flies by and this is my first post this year, 7 months without sharing new article can’t believe it, anyway this time I’d like to share removing ‘Continue Reading’ button on manually inputted excerpt, we have to talk few filters here and don’t worry it’s easy.

So lets get started

Filter Reference

excerpt_more, this is used to filter auto generated excerpt, just in case you need to also, and

get_the_excerpt this contains the excerpt string and this is what we need.

Below is a simple Hook that would do the Job.

Lets explain it piece by piece

I’ve added condition here to check whether the current post contain manually inputted excerpt then display our custom ‘read more’ or ‘continue reading’ button, you can remove or comment it out if you don’t need custom read more button, but just in case 😉

This regex simply replaces ‘Continue reading.’ button to empty string, and this is what we only need.

Visit the_excerpt() for full reference.

Hope that helps, happy coding ^_^

by Ryan Sutana