An excerpt in WordPress is a shortened version of a blog post or page that is often used by WordPress themes to give a quick look at the content. Most of the time, excerpts are shown on the homepage, topic pages, and other archive pages. They give a quick summary of the post and encourage users to click through to read the whole thing. The excerpt is a custom field in WordPress that can be added to any page or post. By default, WordPress creates a sample by taking the first 55 words of a post and removing any HTML tags. Users can also make their own excerpts by typing a summary of the post into the excerpt box.
Why Use an Excerpt in WordPress?
A WordPress site needs excerpts for a number of important reasons. Here are a few of the most important reasons why you should use quotes on your site:
They help your site look better and be easier to use: Breaking up long lists of posts with excerpts makes it easier for users to find the information they want. By giving a short summary of each post, excerpts help users quickly decide which posts are interesting to them and which ones they can skip.
They make it better for the user: Users can quickly and easily get a sense of what a post is about without having to click on it and read the whole thing. This can save people time and make it more likely that they will find the information they are looking for.
They make search engines more interested in your site: Search engines like Google look at the content of your snippets to figure out what your site is about and how relevant it is to what people are looking for. By using buzzwords and relevant information in your excerpts, you can help search engines understand what your site is about and raise its ranking in search results.
Want to know how to show excerpts of your posts in your WordPress theme? By showing excerpts of your blog posts instead of the whole piece, you can help people find interesting content quickly and make your site load faster. In this piece, we’ll show you how to add post excerpts to your WordPress hosting website’s blog.
How to Add an Excerpt to WordPress
Method 1: With a Theme
When excerpts are used on the front page, some styles work well. For instance, the excerpt is one of the tools that can be used on the site of the ColorMag theme. But there are other ways to do it because some themes don’t have this feature.
You can do the following to see if your theme has something like ColorMag:
Step 1: Look at your main theme
Click “Appearance” and then “Widgets.”
Scroll down until you see the icon for “Featured Posts.” Remember that every theme is different, so even if yours has the same feature, it may be called something else.
Step 2: Change what the tool does
I use the Color Mag theme, which has a lot of useful tools that are only available on that theme.
Step 3: Save what you’ve done
This tool shows the subject, a small image, and a short excerpt from each post. You can choose how many posts to show. You can change it so that it works for you. Click the “Save” button when you’re done.
You can put widgets on ColorMag’s Frontpage (homepage), so you can put these selected posts, excerpts and all, on your home page.
With other themes, you can choose from a range of lengths for your sample. This is normally between 55 and 60 letters. But you might be able to change the length if you look at how your theme is set up.
Even if your theme doesn’t have this option, there are other ways to add a sample.
Method 2: Writing by hand an excerpt
Step 1: Open a Post
If you use WordPress, you can write your own Excerpt. If you haven’t made a post yourself, WordPress will use the first 55 characters of a post that someone else has made. If the word is too long, it will end with an ellipsis (…).
If you just starting using WordPress, don’t worry if you forget to use the excerpt option when making posts. It is easy to overlook.
Note: The choice to write your own excerpt is turned on by default in the Gutenberg editor. In the normal editor, you have to go to Screen Options and turn it on.
Make a new post or open an existing one.
Step 2: Open Settings
If you click the “Settings” button, the post options will show up.
Step 3: Click the “Expand Excerpt” button.
Now, a list of options for the post will show up. Click “Excerpt” to enlarge it.
Step 4: Type in the quote
Here is where you can type the text. Remember that this is just a short bit of writing. You can make a sample for all of your content, even if it has already been published. Make sure it’s interesting and tells you a lot about the post.
Note: Samples are not available on landing pages and other static sites. This is because a page is not the same as a post. The system doesn’t group pages the same way it does posts.
The third way is to use the admin panel to add excerpts.
Find the right file first.
You can add code to most things in WordPress to get the results you want. Again, there is a central idea here. The info for each theme is kept in a different place. So the first step is to find the file where it is.
The only way to do this is to look for bits of code in each file. Most of the time, you’re most likely to find sample code in:
Index category archive index
This might look like a lot of work, but it’s not. Once you’re in a file, use CTRL+F to find this line of code:
Step 1. The Code
“<?php the_content();>”
You are in the correct file once you locate the code. If not, refer to the support page for your theme to determine where it should be.
Step 2. Replace the Code
We strongly advise making a backup of your website before making any modifications to the code. This will guarantee that you can fix any errors that are committed.
Change the code you discovered to <?php the_excerpt(); >
You should now be able to enter excerpts from your admin dashboard, depending on your theme.
Step 3. Modify the Excerpt Length
The ability to change excerpt functionality in WordPress while editing the code is one of the key benefits of doing so. WordPress restricts excerpts to 55 characters by default. In some circumstances, the design of your website might be able to accommodate longer extracts.
As a result, you might want to alter the excerpt’s length.
By making changes to the functions file in your theme, you can modify the excerpt information. The following code needs to be copied and pasted into your functions file:
// Changing excerpt length
function new_excerpt_length($length) {
return 100;
}
add_filter(‘excerpt_length’, ‘new_excerpt_length’);
// Changing excerpt more
function new_excerpt_more($more) {
return ‘…’;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
You simply need to update the line beginning with “return 100;” in this code. The character limit for the snippet is indicated by this “100”. Consequently, this code will limit it to 100 characters. Adapt the value to your website’s needs. To discover the ideal fit for your particular plan, some trial and error may be necessary.
Conclusion
Displaying the post’s excerpt might be a very effective technique to engage the audience that is visiting your site. It provides them with the opportunity to acquire an overall sense of the material and has the potential to lessen the amount of “bouncing” in Google Analytics. Make it simpler for your visitors to access the content you’ve provided, and offer any additional details they might find valuable.
Here is hoping that you have understood the article. If you have any doubts or queries pertaining the same, please share them in the comments section below.