How to change WordPress post excerpt length for beginners

Guys, I am here today with an exciting topic. I will write about How to change WordPress post excerpt length for beginners. You may also call it WordPress post summary control. It is very easy to replace. So without further ado, let’s get started.

How to change the WordPress post excerpt length-featured-min

What is WordPress post excerpt length:

WordPress post excerpt length means the summary of your WordPress post in your WordPress website. In your index page or your blogs page, you will see a brief of your WordPress posts. After a summary, you will probably see a read more button. Sometimes, you have to change the length of your posts summary to make your website more user-friendly. That is called WordPress post excerpt length or WordPress excerpt post limit. So let’s learn how to control this excerpt.

What is post excerpt length in wordpress

How to change WordPress post excerpt length:

A plugin can help you to control the excerpt length. The name of this plugin is Advanced Excerpt by WPkube. To download the plugin, please follow the link below:

Download advanced excerpt plugin

Download and install the plugin at first, Then go to Settings > Excerpt, and you will find several options to control your excerpt length. Please check the image below for better understanding. If you don’t know how to install the plugin, you can read the other post by Lets Learn Now. It is how to install a plugin in WordPress.

How to change WordPress post excerpt length for beginners (1)-min

How to change WordPress post excerpt length in LLN Blog Theme:

If you are an LLN Blog user, you may not be able to use the custom excerpt length by this plugin by default because we use a different method to show the post summary. But you can control the length of the post more efficiently by our default Theme Options. You don’t need another extra plugin to manage the post summary length. In our LLN Blog theme, we have used a built-in option to control the length.

How to change WordPress post excerpt length for beginners (2)-min

Once you install the theme, you will find some theme options in WordPress Dashboard menu, click Theme Options > LLN Theme Options and then see the option Post Summary In Words. Enter your desired number here. That means how many words you want to show in the index page in your post summary. But if you don’t’ enter any value, it will be set 35 by default. But please make sure that the box is not empty.

How to Customize WordPress Post Excerpt:

If you want to customize the WordPress post excerpt, you can do that too. Just use the build in excerpt option. When you are editing a post, click Screen Options, and you will see several checkboxes here. You should check the excerpt box if you are willing to put custom post summary. That means you can enter different excerpt/post summary for every post. But if you don’t do that, WordPress will use the first 35 words of your post as an excerpt. So that is up to you whether you will select or not. You can leave it if you don’t want to show a different passage.

How to change WordPress post excerpt length for beginners (3)-min

How to change WordPress post excerpt length by functions.php

If you are not willing to use the plugin, you can control the post excerpt by using functions.php too. You may need to know some basics of coding. You should go to your editor menu and go to the functions.php editing page. Then add some codes here to control the post excerpt.

function custom_excerpt_length( $length ) {
return 35;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Just replace the number 35 if you want to show a different length. There are other methods too. You can use the same functions like this.

add_filter( 'excerpt_length', function($length) {
return 20;
} );

The result is the same. They are just two different functions style. You can use any of them.

Advance use of WordPress post excerpt length:

You can also experiment some advance use of post excerpt. For example, you may see some HTML attributes included in your excerpt. It may look odd. You can remove all of the HTML tags just by adding a simple function while calling the post excerpt in your WordPress theme. Just call the_excerpt functions like that

<?php echo strip_tags(get_the_excerpt()); ?>

This function strip_tags will remove all the HTML tags from your excerpt, and your excerpt will look better. But don’t’ forget to use get_the_excerpt() instead of the_excerpt() because the_excerpt() function will directly print the excerpt. Use get_the_excerpt() instead to get the excerpt and control the tags using the strip_tags() function. That’s it.

LLN Team

About The Author : LLN Team

We are LLN Team promise you to provide you useful information about website and blog creation. We will focus on WordPress and other essential needs. Keep browsing Lets Learn Now. Cheers

Leave a Reply

Your email address will not be published.

Please post a relevant comment and make the conversion informative.