Press "Enter" to skip to content

How to Craft Custom Post Excerpts with WordPress

Most WordPress users don’t know this, but there are three ways you can create post excerpts.

First off, will WordPress automatically create an excerpt for your post if you don’t define one. The excerpt is 50 words but that count is likely modified by your theme. Automatic excerpts strip out all HTML so there are no images or links included.

Next, you can insert a “More” block anywhere in the post to create an excerpt. Everything above the More block will be included in the post excerpt shown on the blog page. All HTML elements including links and images will be preserved.

Lastly, you can use the Excerpt section found in the right sidebar of the post editor. This option lets you add a completely custom excerpt. Personally, I always reuse my meta descriptions from Yoast SEO as my excerpts since these 1-2 sentence descriptions are written to encourage visitors to click on my post.

Transcript

Hey, this is Ben from WPAnswered.com. In this video, you'll learn how to create custom post excerpts. When you publish posts in WordPress, you might see something like this: a featured image, a title, a byline, and an excerpt that automatically uses a certain number of words from the beginning of your post. Now the number of words that appear here will depend on the theme that you're using. In this case, I'm using the minimalist Apex theme by Compete Themes and I also have the option to control the number of words that show up in this excerpt. But regardless of what theme you're using, there are three different ways you can define your post excerpts. First of all, you can do nothing at all and you'll have the first, um, usually 25 to 50 words used here, followed by an ellipses, or you can use a "read more" tag.

And that is the second way to define your excerpt. So I'm going to click on the title to take me to this post. As you can see, I've got some filler text, just some nonsense language here, followed by an image and some more text. And if I click Edit Post in the admin toolbar, this will take me to the Gutenberg post editor. Inside here. Um, let's say I want to use this entire paragraph as my excerpt. I can press the Enter key, click on the Add block button and you can see the more tag included in my Most Used section. But if you've never used it, you can find it in the Layout Elements section, or you can always search in the search bar for more. Once I press it, it will be included in my post. And after I update and visit my homepage, you'll see the excerpt now includes this entire section that I defined with the read more tag.

Everything above it is used as the excerpt. The one other benefit, which actually could be a con depending on what you want in your excerpt, um, of using the read more button, is that if you do add a read more block, I should say, it will include everything above it, including images, links, bullet points. All the HTML that shows up that would normally be stripped from an excerpt will show up when using the read more block. So I'll place in another more block just to show you how this works and when I update my posts, you'll see that it now displays the image and the text following it. Just to further illustrate this, if I was to add a link, and right now I'm highlighting some text, and now pressing Command+k to open up the link input, and I'm just going to include a link to google.com, update, and refresh.

You'll now see this text is linked here. If I remove the more block and switch back to the automatic excerpt, you'll see that it removes the link. So whenever you're relying on an automatic excerpt, it will automatically remove all HTML. So if there was an image between these two words here, it would be removed as well. Links get removed. If you want to maintain the HTML that you have, images, links, lists, anything like that, you'll want to use a read more tag instead. Now there's a third method which is what I recommend using and this is what I use on all of my sites. It's to use the custom excerpt option instead. And in here you can type whatever you want and then this text will show up in the excerpt section. Now what's so nice about using a custom excerpt is that you don't need to worry about what you've written as the main introduction to your post.

Instead, you can concentrate on writing a teaser, a short amount of text that's designed - when people are browsing through your posts - this text is designed to get them really excited to read your post. So they show up, the image gets their attention, the headline sounds good, and then when they read the excerpt they just have to read it. And so taking the time to write, um, to write excerpts that really make your posts sound exciting and interesting, it's definitely worth your time. One other tip I'm going to recommend is that if you use the popular Yoast SEO plugin and you're writing your meta descriptions, you may as well copy and paste those meta descriptions into the Excerpt box so that they show up on your main blog page as well.

I hope you learned a lot from this video. If you liked it, please remember to click the Like button below. If you want more WordPress tutorials, click Subscribe, and if you have any questions, go ahead and post them in the comments section below. Thanks for watching.

Ben Sibley
Ben Sibley

After using WordPress for the last 9 years, I've made dozens of websites, designed and developed 20 themes that have been downloaded more than 1.5 million times, and personally helped thousands of WP users with their sites.

Now I'm sharing everything I know to help make WordPress an easier and more rewarding choice for building a website. If you have a question you want answered, submit your question here.