Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Customize WordPress Excerpts (No Coding Required)

Do you want to customize your WordPress excerpt?

An excerpt is a short snippet from your post that you can display in a list of blog posts or on other key pages of your website.

In this article, we will show you how to customize your WordPress excerpts without writing any code.

Customizing WordPress excerpts without coding

Video Tutorial

Subscribe to WPBeginner

If you prefer written instructions, then just keep reading.

When and Why You Should Use Excerpts in WordPress

First, let’s talk about when it makes sense to use excerpts and why it’s a good idea to do so.

By default, WordPress shows full posts on your home page, blog page, and archives of your site.

This makes your WordPress website slower, and it can also cause issues with search engines because it means you will have duplicate content on your site.

Using excerpts will make your pages load faster because you will only be loading a small part of each article. You may want to use excerpts on:

  • Your website’s homepage, if it displays blog posts.
  • Your various archive pages for categories and tags.
  • Your blog post page, if you have a static home page.

Many WordPress themes are configured to use excerpts by default in places like your home page. With premium WordPress themes, you may have the option to choose whether you want to display full posts or excerpts.

For more details, see our article on full posts vs. excerpts for more reasons to use excerpts.

Why You May Want to Customize Your Excerpts

If your WordPress theme uses excerpts by default, then WordPress will automatically generate an excerpt for you. By default, WordPress uses the first 55 words of your post, though many themes will show a little more.

So what’s wrong with that? Can’t you just save time by letting WordPress come up with the excerpt for you?

Here’s the problem. The auto-generated excerpt will begin with whatever text is at the start of your post. This can be fine in some cases, but it doesn’t work so well if you have anything before you start your post’s introduction.

Here’s an example from a site using the Ribosome theme:

A post excerpt shown in the Maxwell theme. Post text reads 'Image credit: 200degrees This post was last updated in April 2020. What's the best way to build your email list? We've come up with 35 great options for you. Whether...''

As you can see, the excerpt shows the text from the very start of the post. This includes the featured image credit plus a note about when the post was most recently updated. This does not look very good.

If your theme does not handle excerpts very well, you may want to customize them to make them easier to read and help you get more clicks for posts.

That being said, let’s look at different ways to customize excerpts in WordPress. You can use the following links to jump to whichever method you want:

1. How to Add a Custom Excerpt in WordPress (Default)

Adding a custom excerpt in WordPress is quite simple. First, you need to create a new post or edit an existing one.

In the right-hand panel of the WordPress content editor, you should see the ‘Excerpt’ dropdown. Click the downward arrow next to it.

Expand the Excerpt tab in the Document pane

It will expand to show the excerpt box.

You can type your custom post excerpt here. We simply copied the first paragraph of our post itself.

Adding custom excerpt for a WordPress post

Note: If you are still using the old classic editor, you need to click the ‘Screen Options’ tab in the top right corner. Then, put a check in the ‘Excerpt’ box. You will now see a space for your excerpt below the box where you write your post.

Your WordPress theme will now use the custom excerpt for this post.

Preview of a custom excerpt added to a WordPress post

As you can see, the Read More link is not displayed after the excerpt. Depending on the theme you use, custom excerpts may not have this link.

The reader can still click on the post title or post’s featured image to read your full post.

2. Changing Excerpt Length

If you want to change the length of excerpts on your site, you can use the free WPCode plugin. It is not only the easiest and safest way to add custom code to your site, but it also comes with a large library of pre-configured code snippets.

We will be using one of these built-in snippets today.

To begin, you need to install and activate WPCode. For more details, you can check out our step-by-step guide on how to install a WordPress plugin.

Once activated, you can go to Code Snippets » Add Snippet in your WordPress admin panel and search for ‘excerpt.’

Hover your mouse over the result titled ‘Change Excerpt Length’ and click the ‘Use Snippet’ button.

Searching WPCode for the snippet keyword

The plugin will then insert the following code snippet for you:

add_filter(
	'excerpt_length',
	function ( $length ) {
		// Number of words to display in the excerpt.
		return 40;
	},
	500
);

After that, you will see the ‘Edit Snippet’ screen. WPCode has already pre-configured all the settings for you.

By default, this snippet will limit the excerpt to 40 words. You can adjust the number on Line 5 to whatever works best for your WordPress blog.

WPCode changing the number of words in an excerpt and activating a snippet

Once you have set the length of the excerpt that you want, you just have to toggle the switch to ‘Active’ and click the ‘Update’ nutton.

Now, when you visit your site, the shortened excerpts will be wherever your theme shows them.

Below is an example of what it would look like using the Twenty Twenty-Two theme and setting the WPCode snippet to display 5 words.

Example of the trimmed snippet in WordPress

Note that the snippet from WPCode only works with the default excerpts that WordPress generates.

Changing the Length of Custom Excerpts

If you want to change the length of custom excerpts, you will need to add a separate, custom snippet into WPCode. It’s very easy to copy and paste code snippets into WordPress, and since we are using WPCode, doing so follows many of the same steps as above.

First, navigate to Code Snippets » Add Snippet. Just hover your mouse over ‘Add Your Custom Code (New Snippet)’ and click on the ‘Use Snippet’ button.

WPCode Add new Snippet

Next, you see the ‘Create Custom Snippet’ page.

You will now need to give your new snippet a title and then paste the following code into the ‘Code Preview’ field:

add_filter( 'get_the_excerpt', function( $excerpt, $post ) {
	
	$excerpt_length = 40; // Change excerpt length 
	$excerpt_more   = '...<br><br><a href="' . get_permalink($post->ID) . '">Read More »</a>'; // Add ellipsis and 'Read More' permalink text when trimmed
	
    if ( has_excerpt( $post ) ) {
        $excerpt = wp_trim_words( $excerpt, $excerpt_length, $excerpt_more );
    }
	
    return $excerpt;
	
}, 10, 2 );

You can change the value for $excerpt_length on Line 3 to choose how many words your custom excerpt will be.

Additionally, editing the text highlighted below on Line 4 will change the anchor text for the Read More link when the excerpt is trimmed.

WPCode edit custom excerpt length and activate it

When you have customized the snippet to your needs, make sure the ‘Code Type’ is set to ‘PHP Snippet.”

Then, you can go ahead and toggle the switch to ‘Active’ and click the ‘Save Snippet’ button.

Now, when you visit your site, you will see that your custom excerpts are shortened to the length you chose on Line 3.

3. Changing Read More Text for Excerpts

In addition to the snippet above, you can also use the WPCode snippet library to change the ‘Read More’ text that appears with excerpts in most themes.

Just install and activate the free WPCode plugin. For more information, you can follow our step-by-step guide on how to install a WordPress plugin.

Once activated, you can go to Code Snippets » Add Snippet in your admin panel. From there, just search for ‘excerpt’ and hover your mouse over the result titled ‘Change Read More Text for Excerpts.’

Search for a WPCode snippet by name

You can click the ‘Use Snippet’ button to go to the ‘Edit Snippet’ page. WPCode has already pre-configured the code snippet for you and, by default, is set to say, ‘Read the whole post.’

However, you can replace the text on Line 4 with anything you want.

WPCode on the edit snippet page to change the read more text for an excerpt

Whenever you are happy with your new text, just toggle the switch to ‘Active’ and click the ‘Update’ button.

4. Displaying Excerpts in Your Theme

Most popular WordPress themes come with built-in support to display custom excerpts on your posts.

However, some themes may not have excerpt support. If that’s the case for yours, then you will need to manually modify your theme templates.

Adding Post Excerpt in Block Themes

If you are using a block theme, then you can go to the Appearance » Editor page to edit your theme in the Site Editor.

This will open the site editor. Click on the template you want to edit from the left sidebar or simply point at the area where your posts are displayed.

Site editor

The site editor can display your latest posts using the Query Loop block, which is the standard way to display a list of posts.

After adding the Query loop block, you need to click on the ‘Choose’ button to select a pattern.

Query loop block

WordPress includes several layouts as patterns for the Query Loop, you can choose from grid, table, list, and more.

The generated post template will now automatically display your post excerpt.

Excerpt block

However, the only thing you can change here is the read more text.

Adding Post Excerpt in Classic Themes

If you are using a classic theme, then you can add a post excerpt by creating a child theme and adding some code.

This adds some complexity to the process, and if you are uncomfortable with that, then you can use method 3 in this article which does not require you to add any code.

In your child theme, you will need the template used to display the pages you want to modify. See our guide to WordPress template hierarchy to figure out which template you need to edit.

The filenames will differ slightly depending on your theme, but you are likely looking for home.php, content.php, archive.php, and category.php.

In each of these files, you will need to find this line:

<?php the_content(); ?>

Next, you will need to replace it with the_excerpt tag like this:

<?php the_excerpt(); ?>

Important: We don’t recommend this method for beginners. Even if you are quite experienced with WordPress, you might want to avoid creating a child theme and editing your template files.

The next two methods are great alternatives.

5. Showing the Start of Your Posts With the More Tag

Another way to create a short version of your post for your WordPress homepage and archive pages is by using the ‘More’ tag.

This works a bit differently from an excerpt. Instead of creating a text-only snippet of your post, the More tag lets you break off your post at a certain point.

This means only the first part of your post (up to the tag) will show in the list of posts on your homepage, categories page, and so on. The benefit of the More tag is that it keeps all your formatting.

At the point where you place the More tag, WordPress will show a ‘Read More’ link. Readers can click on this to go to your whole post. They will be automatically jumped to the right point in the post, too.

To create a More tag, create a new post or edit an existing one.

Next, you need to add a block where you want the More tag to go. Select the More block from the Layout Options section or search for it using the search bar.

Adding the More block

This is how the more tag will appear inside the content editor.

Optionally, you can choose to hide the content before the More tag on the actual post.

More tag in content editor

Note: You can also add a More tag in the old classic editor. Click where you want to place the tag in your post itself, then click the More button in the visual toolbar.

Virtually every theme will be able to use the More tag anywhere that posts are displayed. Note that if your theme displays excerpts, though, you will need to customize the excerpt itself. You can’t change it by adding a More tag to posts.

6. Adding Custom WordPress Excerpts Using Plugin

What if WordPress’s built-in custom excerpts functionality doesn’t do what you want … and you don’t want to use a More tag either?

There’s an easy solution. You can use a plugin to create and display custom excerpts.

First, you need to install and activate the Advanced Excerpt plugin.

If you haven’t installed a plugin before, take a look at our step-by-step instructions on how to install a WordPress plugin.

Once you have activated it, you can go to Settings » Excerpt to set up how it works.

Advanced excerpt settings

Here, you can change things like how many characters or words the excerpt will display. You can decide whether to allow the excerpt to cut off mid-word or mid-sentence, too.

You can also restore the ‘Read More’ link that normally disappears from the custom excerpt. You can even change this to whatever text you want and change how it functions:

Restoring and customizing the 'Read More' link using the Advanced Excerpt plugin

Tip: To use custom excerpts with this plugin, uncheck the box ‘Generate excerpts even if a post has a custom excerpt attached.’

It looks like this.

Use custom excerpts with the Advanced Excerpt plugin

After making changes to the Advanced Excerpt settings, make sure you click the ‘Save’ button at the bottom of the screen.

With the Advanced Excerpt plugin, your excerpts will preserve your post’s formatting. Here’s an auto-generated excerpt with the plugin activated.

As you can see, the line break and italic text have been kept in.

Post excerpt produced by Advanced Excerpt plugin

By default, the Advanced Excerpt plugin will use excerpts on your home page, RSS feed, and other archive pages.

It does not make any changes to your content, and if you want to turn it off, then you can simply deactivate the plugin.

We hope this article helped you easily customize WordPress excerpts without any coding. You may also like our list of the plugins every business site must have or our guide on how to get an SSL certificate for your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

41 CommentsLeave a Reply

  1. Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

    • If you wanted a custom length for a specific post or page then you would want to manually set the excerpt in the post/page itself.

      Admin

  2. Hello,
    in code editor is there a way to display the Excerpt tab in the main window instead of in the side bar?

    • We do not have a method we would recommend at the moment to force it into the main editing area.

      Admin

  3. I’m facing a big problem. The excerpt is showing perfectly in desktop and tab responsive mode on the post. But the main issue is, it is not showing up in mobile responsive mode. What should I do…..?

    • It would depend on the specific theme you are using as each theme has different styling but if you reach out to your theme’s support they can normally assist with the mobile styling.

      Admin

  4. So I’m having an issue where anything I write in the excerpt box DOES NOT display verbatim but only display the first 40 characters or whatever from the content summary. What am I doing wrong here?

    • You would want to check with your theme’s support as it sounds like a design for your specific theme.

      Admin

  5. I may have missed it, but what I was looking for and did not find is how it looks to the user. A user sees a web page or post, sees the excerpts, clicks the more button–where and how does it display? It’d be meaningful to include in this post — unless you already did and I missed it!

    • The display would heavily depend on your specific theme, as each are different we can’t say how your specific theme will display the excerpts

      Admin

    • If you reach out to the plugin’s support they should be able to assist you with a conflict like that.

      Admin

  6. The new versions of the post editor hides the “add more tag” button.
    The way I found to solve the problem was installing the classic editor plugin.

    • For adding it in Gutenberg, you can use the more block or the manual excerpt can be found in the document’s settings :)

      Admin

  7. I have installed the Advanced Excerpt plugin, selected a place on my posts for the Read More button & made sure except was selected in my screen options in the drop down box at the top but it doesn’t work. I have a long posts on my home page, no Read More button & don’t see how the plugin makes any difference at all. Please help. Thanks.

  8. This article is helpful for posts on the site, but does it carryover to automated emails sent to subscribers when new post is added? Currently emails show the entire new post, not giving them a reason to visit the site.

  9. This was SO helpful. I tried the first two, which did not help. But the last one, installing the Advanced Excerpt plugin – THAT DID THE TRICK! Wish I would have found this before I had invested so many hours in trying everything else under the sun. Thank you!

  10. That was a great post! I’ve been looking to remove image captions from being pulled into post excerpt summary – this easily did the trick! Also looking into this plugin too as need a call to action button not showing up at present. TY!!

  11. Thank you very much. Ive been thinking for a long time, how to extend “excerpt” . Even try to find it somewhere in the code. Very greatful for this information.

  12. I am making a blog with wordpress free and with sapor I am stuck because I don’t know how to change a photo they already had on the blog I pressed a button on the top right corner and I chose a image and it came on top of the photo that had on I’m trying to change their one not add another so could you tell me how to do it (I’m doing it with sapor)

    Kind regard’s
    John

  13. I want to completely remove the automatic excerpt from appearing on certain posts display modules. Any advice?

  14. Can you help me remove “read more” on my post pages. Even my privacy policy page have this annoying “read more” button. I installed WP and already had this button. Thanks!!

  15. Dear Author,

    Can you guide me on how to allow link (tag) on my post excerpt on Recent Post Extended plugin please? I tried few things – adding the tag on excerpt box, tried few things that I found online the last 3 hours, but no successful result. Please help.

    Thank you and regards,
    Ihsan

  16. WordPress is a powerful CMS platform that can handle large chunks of data through easy to use interface. Over a website it is important to showcase the offerings on the landing page to attract more visitors. WordPress provides excerpts that helps a developer to add a summary block to the webpage. This size, shape and color of the block can be customized by the user. The links to the entire content can be placed in the block and can be managed manually from the dashboard. Use only the authenticated plugins like Advanced Excerpt that doesn’t compromise the website security.

  17. The plug-in is a nice idea but I’d like to use an image instead of text for the “Read More” and haven’t found an easy way to accomplish it.

  18. hello,
    this website has exactly the same Article.

    I wonder who to create original article.
    often it is the same article, but in other language.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.