Controlling the Number of Words to show in excerpt

[Update: You can now simply control the excerpt via using a Plugin. Some Latest Themes have a built in function which will give you the option to choose the number of words to show]

I will not say that displaying summaries of posts in WordPress Blog’s index page help to get rid of any duplicate content issue but I personally feel safe via doing this.

That is: I prefer to display only the summary of posts on the home page of my WordPress Blogs.

I already showed how to do this here post.

However, there is another thing I would like to tell. That is: you can even control the amount of content that will be shown in the summaries.

In order to edit the amount of words that are shown in summaries in WordPress blogs, you need to edit a WordPress core File.

You need to edit this File “formatting.php”. You will find this file here: wp-includes\formatting.php.

Open this file in any HTML editor you use [You can even open it in Notepad]. Look for this line in this file

function wp_trim_excerpt($text)

We will edit this function.

Now look for this line

$excerpt_length = 55;

The 55 is the default Excerpt value. You can change this value to decrease or increase the amount of words that will be shown in the post summaries.

Change the value, save the file and then upload it via FTP to your server.

  1. WordPress Plugin: Send an Email Notification ONLY IF Someone Replies to My Comment
  2. WordPress: How to remove Elements from the Head Section: Via Editing the Core Files?
  3. How to Remove CleverPlugins Advertisement/News from WordPress Dashboard
  4. WordPress: Cannot get rid of All
  5. WordPress: How to remove the Index, Start, Next, Prev Link Elements

*