When you create a custom excerpt and people share your content via social media, you can control what people see. Instead of them just seeing the beginning of your post, they see a customized short message that explains what that post is about. Using excerpts or the more tag also makes your content much easier scroll through on an index or archive page.
- [Voiceover] WordPress has a great feature that probably doesn't get used as much as it should, and that's the ability to truncate content, and create custom excerpts for archive, or index pages. In most WordPress themes, including the one I'm currently using, if you write a long post, and do nothing, that post will appear in its entirety on the blog index, or other index pages. You might recall this from a recent look at the Short Stories category archive index. All these long posts can make it annoying to readers as they have to scroll through entire posts to get to the next one.
It's even more annoying to scroll through this on mobile. Additionally, it makes index pages much larger, which results in longer paste-load times. By default, WordPress puts ten posts on an index page. Imagine if you have ten posts, and each of those posts has a lot of images, and you have to load them all on an index page, well that's gonna take a lot of time, and a lot of bandwidth. To solve this, WordPress provides a way to truncate your post for display on index pages in two ways. The first way is to select a point in your post where you want a Read More link to appear.
Let's take a look at how to do this. From the front end of my site, I'll go to the post I want to edit, and then click the edit post button to get to the editor. Now, I need to decide where to truncate this. I'm gonna do it right after this sentence. I'll create a new line, and then I'm gonna insert this Read More tag. With the More tag inserted, let's update the post, and then go back to the front end of the site. Here, I can see that the post has been truncated. I've got these first two paragraphs, and then a link that says Continue reading.
If I follow the Continue reading link, I'm taken directly to the next section within my article. So, we're skipping past the content that we assume the reader has already read on the front page. This truncation has many advantages. It's much easier to scroll through all the content, and if your theme, like 2015, the one I'm using here, displays all this extra post meta at the bottom of the post, it's much easier to get through. You don't have to scroll past tons of text to get to all the information. So, that's the first way to truncate posts, but you can also do it by using excerpts.
To show you how this works, I'll give you an example. So, here on my site, let's do a search for dog. Here, I'll get an index of all of the posts that have the word dog, either in the title, or in the content, but unlike other indexes, this index shows the post title, followed by an automatic excerpt that grabs a certain number of letters from the top of my content, and just displays that, and as you can see, what it's done here is just grabbed the first couple of paragraphs, and cut it off right in the middle. All the styling is gone, the links are gone, and we're only seeing this excerpt with the Continue reading.
Now, the way this displays is entirely theme dependent. Different themes handle different excerpts differently, and different themes will even display them in different places. In 2015, that I'm using, we only see the excerpts in these search results, but in other themes, you might see excerpts on all indexes. The problem with this excerpt, as you can see, is that it just takes the beginning of the post and sticks it up there. So, if my post started with, say a bunch of images, you would just see the URLs to the images, and that would make absolutely no sense.
So, instead, what I want to do here is control the excerpt. To do that, I need to go to my blog post and edit this post, then I'll expand this More Options section. Once that's opened, I can find the excerpt field, and this is where I can place my new custom excerpt. This excerpt serves a couple of purposes. First of all, it'll show up anytime the theme asks for an excerpt. So, that means, now I can update this post, jump back to the search results, and see that the new custom excerpt has replaced that automatic excerpt that was there previously.
The second benefit here is even more important than the first one. When you create a custom excerpt, and people share your content via social media, you can control what people see. Instead of them just seeing the beginning of your post, they see a customized short message that explains what the post is about. So, now that you know how truncation through the More tag and excerpts work, test out how your theme handles and display these, and keep in mind, the excerpts may appear in odd places, like only on the search index, or only in the category index, or somewhere else.
- Creating a WordPress.com account
- Updating your profile
- Importing content
- Publishing posts
- Applying categories and tags to posts
- Inserting images, videos, and other media
- Creating a new page
- Customizing your site with themes and widgets
- Managing users, notifications, and comments
- Using WordPress.com apps
- The limits of WordPress.com and the benefits of self-hosting