How to customize the Excerpt length in your WordPress website

You must have noticed the excerpt from the WordPress post on your website. Every theme has a dedicated layout for the excerpt on a blog page. You can accordingly customize the Excerpt length in your WordPress website.

We are going to share all the ways you can customize the Excerpt length in your WordPress website. But before that Let’s just talk about the Excerpt and Its use in your WordPress website.

What is Excerpt Length in a WordPress Post?

It is a short text which you might show to the reader as an Intro of the article. This is basically fetched from the beginning of the article & shown at various different places. With Excerpt, you can excite the Readers to check out the complete article.

This helps in attracting the audience at places where you show all the posts. By default, WordPress has a limit of Excerpt Length as 55 words.

It is always better to include the catchy lines in the first few words of an article. As a result, it will end up showing in the excerpt which will eventually result in attracting the audience.

Method 1 – Manually Change the Excerpt Length in WordPress

If you are okay with editing some source files, you can continue with this method. Simply, follow the instructions and change the excerpt length manually.

Step 1: Open the WordPress dashboard of your website

Step 2: Go to Appearance and then click on Theme Editor.

Step 3: Now, you need to open the file functions.php in order to edit the functioning of the theme.

Step 4: Paste this code in your functions.php file

function my_excerpt_length($length){

return 80;

}

add_filter(‘excerpt_length’, ‘my_excerpt_length’);

Step 5: At the place of 80, you can set any number of your choice. This will end up displaying 80 words in your excerpt. You can set it to 55 or 90 as per your choice.

Step 6: Once you are done, you can save the changes by clicking on Update File. This will save the file

There are some themes which might require extra work from you. If you are using themes like Twenty Sixteen, etc, you will need to edit the content.php file as well.

To do so, follow the steps below and check if you can see the changed excerpt length after following these steps:

Step 1: Again, you will need to open the Theme Editor. Just select it from the Appearance option in your WordPress dashboard.

Step 2: Now, you have to edit the content.php file which is under the template-parts. Once you find it, click on it to edit the file.

Step 3: Look for these lines of code in your file

<div class=“entry-content”>

<?php

Step 4: Once you find this code, you need to paste the following code just below it.

if ( is_home() || is_category()||is_archive()){

the_excerpt(‘‘);

}else{

Step 5: Now, Check for the line of code which looks like:

?>

</div><!-- .entry content -->

Step 6: And, paste the following code just above it.

} // end of if statements

 

Step 7: Once done with the changes, you need to save the file. Just click on Update File in order to save the changes.

This will change the excerpt length in most of the themes available for WordPress. Now, you can enjoy customizing the excerpt length of your post. You can set the number of words you want in the previous code where we entered ‘80’ just for the sake of proceeding.

If you don’t want to do it manually, you can even go for the plugin method. In this, you will have to use the Plugins & you can change the excerpt length without editing code manually.

Method 2 – Using Plugin to Change the Excerpt Length in WordPress

You can even use plugins to customize the excerpt length of your WordPress post. It does not require any changes in the source code of your theme. You do not need to do any coding task in order to change the excerpt length in your WordPress website.

Before we begin, Here are the features of the plugin that we are going to share below:

  • You can trim the count of words or character of the Excerpt
  • You can add a Read More button & customize it accordingly.
  • It can complete the last word of any excerpt so it doesn’t end incompletely.
  • You can keep the HTML markup & choose the tags which you want to include for the excerpt.

You can use the plugin from WordPress to customize the Excerpt length. In order to do so, follow the steps below and enjoy changing the excerpt of the blog posts.

Step 1: Go to your WordPress dashboard & Navigate to the Plugins section

Step 2: Now click on Add New Plugins

Step 3: Search for Advanced Excerpt plugin in the search bar.

Step 4: Install the plugin & click on activate in order to use it on your website

Step 5: Now, Go to the settings of the plugin.

Step 6: Here, you will see a bunch of options to customize the way you would like to see the excerpt. Change the settings as per your choice and set the excerpt length accordingly.

Step 7: Once you have made the edits, save the changes by clicking on the Save button from the plugin settings.

Disabling the plugin will restore the WordPress default excerpt. You will have to keep this plugin updated as well.

Methods to Change Excerpt Length in WordPress

Here are the methods that you can try to change the excerpt length in your post. You can either do it manually with the help of code or you can simply use a specific plugin to do so. We are going to elaborate on both of these methods & you can choose the one you like.

If you are using Classic Editor on your WordPress website, you don’t need to go ahead. Navigate to the lines until where you want to add the words in Excerpt.

You can simply click on the Read More button on the top bar of your Editor. This will add a <!–more–> tag in the HTML code for the post. This will set the custom excerpt length for individual posts.

However, the above methods will only work with the Classic Editor. You can even add a custom message for the button like <!–more Continue Reading–>. This will eventually add the custom message to your excerpt & will give a custom touch to your post.

If you are using Block Editor/ Gutenberg Editor, you can move ahead with the methods that we have shared below. Simply follow the steps from these methods and change the excerpt length in your WordPress website.

Let’s Conclude

That was all about How to customize the Excerpt length in your WordPress website. If you have any doubts/queries, let us know through the comments. Facing any problem while following the above methods? Share it with us through the comments.

If you have any other method which works perfectly fine in this case, let us know through the comments. Have an Awesome Day?!!

Previous ArticleNext Article

Leave a Reply

Your email address will not be published. Required fields are marked *