{"id":18778,"date":"2019-09-04T13:00:11","date_gmt":"2019-09-04T13:00:11","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=18778"},"modified":"2024-03-26T14:57:05","modified_gmt":"2024-03-26T14:57:05","slug":"customize-wordpress-excerpt-length","status":"publish","type":"post","link":"\/ph\/tutorials\/wordpress-excerpt-length\/","title":{"rendered":"WordPress Excerpt Length: What It Is, How to Change It + Plugin Recommendations"},"content":{"rendered":"<p>If you&rsquo;re a WordPress user, you already know that the theme and WordPress core automates a lot of the features that dictate how your content is displayed. A common example is how pages display excerpts of your articles. But did you know that you can customize the WordPress excerpt length? This tutorial will explain how you can do just that!<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all in one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-the-excerpt-in-wordpress\">What is the Excerpt in WordPress<\/h2><p>An excerpt is a part of a post that links to the full article. It&rsquo;s used to interest readers and makes them want to read further. It helps to highlight key points of your content as sometimes a title is not enough to get your audience&rsquo;s attention.<\/p><p>By default, WordPress limits excerpts to the first 55 words of your post.<\/p><p>When using the classic WordPress editor, excerpts can be automatically added to your content by pressing the <strong>Read More<\/strong> button. It will add the <strong>&lt;!&ndash;more&ndash;&gt;<\/strong>tag to the HTML, which can be seen in the HTML editor. You can also type in a custom message like <strong>&lt;!&ndash;more Continue Reading!&ndash;&gt;<\/strong>.<\/p><figure class=\"wp-block-image\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/read-more-tag-1.png\"><img decoding=\"async\" width=\"1024\" height=\"373\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/read-more-tag-1.png\" alt=\"Inserting a Read More tag into a WordPress post.\" class=\"wp-image-30587\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1-300x109.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1-150x55.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1-768x280.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1-1536x560.png 1536w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/read-more-tag-1-2048x747.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>Alternatively, you can change its length according to your needs. Providing more text can attract readers&rsquo; attention to the article.<\/p><p>There are different ways of doing this task. Below you will find instructions that will lead you through the process.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-change-the-excerpt-length\">How to Change the Excerpt Length<\/h2><p>The two most common ways to change the excerpt length are either by doing it manually or by using a WordPress plugin.<\/p><h3 class=\"wp-block-heading\" id=\"h-manually-changing-wordpress-excerpt-length\">Manually Changing WordPress Excerpt Length<\/h3><p>The manual method involves tweaking the code. However, you don&rsquo;t need to have in-depth knowledge in any programming language to do this.<\/p><p>Here are the steps to manually change the length of an excerpt:<\/p><ol class=\"wp-block-list\">\n<li>Hover on the <strong>Appearance<\/strong> tab and select <strong><a href=\"\/ph\/tutorials\/wordpress-theme-editor\/\">Theme Editor<\/a><\/strong>.<\/li>\n\n\n\n<li>Open the <strong>functions.php<\/strong> file and insert the code: <code data-enlighter-linenumbers=\"false\" data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">function my_excerpt_length($length){ return 80; } add_filter(&lsquo;excerpt_length&rsquo;, &lsquo;my_excerpt_length&rsquo;);<\/code> <\/li>\n\n\n\n<li>Change the word limit from 80 to any number you like, and press the <strong>Update File<\/strong> button.<\/li>\n<\/ol><p>For some themes, like Twenty Sixteen WordPress, you&rsquo;ll need to edit the <strong>content.php<\/strong> file as well. Follow the guide below:<\/p><ol class=\"wp-block-list\">\n<li>While still in the <strong>Theme Editor<\/strong>, scroll down until you find <strong>template-parts<\/strong>. Under that heading, click on the <strong>content.php<\/strong> file.<\/li>\n\n\n\n<li>Search for the lines: <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">&lt;div class=&ldquo;entry-content&rdquo;&gt; &lt;?php<\/code> <p>Add the following code snippet just below them:<\/p> <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">if ( is_home() || is_category()||is_archive()){ the_excerpt(&rdquo;); }else{<\/code> <\/li>\n\n\n\n<li>Find the statements: <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">?&gt; &lt;\/div&gt;&lt;!-- .entry content --&gt;<\/code> <p>Then insert the following line above them:<\/p> <code data-enlighter-language=\"php\" class=\"EnlighterJSRAW\">} \/\/ end of if statements<\/code> <\/li>\n\n\n\n<li>Click <strong>Update File<\/strong>, and you&rsquo;re done!<\/li>\n<\/ol><p>The final result will look something like this:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"900\" height=\"318\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/wordpress-excerpt-length.png\" alt=\"Wordpress excerpt length example.\" class=\"wp-image-18787\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/wordpress-excerpt-length.png 900w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/wordpress-excerpt-length-150x53.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/wordpress-excerpt-length-300x106.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/wordpress-excerpt-length-768x271.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-changing-wordpress-excerpt-length-with-a-plugin\">Changing WordPress Excerpt Length With a Plugin<\/h3><p>One of the easiest ways to customize excerpt length is by changing it with a plugin. A recommended option for this task would be the <a href=\"https:\/\/wordpress.org\/plugins\/advanced-excerpt\/\" target=\"_blank\" rel=\"noopener\">Advanced Excerpt<\/a> plugin. It&rsquo;s free and easy to use.<\/p><p>By using the plugin, you can:<\/p><ul class=\"wp-block-list\">\n<li>Trim the excerpt by word count or characters.<\/li>\n\n\n\n<li>Add a &lsquo;Read More&rsquo; link and customize it.<\/li>\n\n\n\n<li>Complete the last word of the excerpt so that it doesn&rsquo;t end midway.<\/li>\n\n\n\n<li>Keep the HTML markup and choose which tags will be included.<\/li>\n<\/ul><p>To install it, hover on <strong>Plugins<\/strong> on your <a href=\"\/ph\/tutorials\/wordpress\/how-to-login-to-wordpress-dashboard\">WordPress Dashboard<\/a>, and press <strong>Add New<\/strong>. Type in &ldquo;advanced excerpt plugin&rdquo; in the Keyword bar. Click the <strong>Install Now<\/strong> button, then <strong>Activate<\/strong> it.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1200\" height=\"466\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/advanced-excerpt-plugin.png\" alt=\"Searching for Advanced Excerpt plugin.\" class=\"wp-image-18788\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin.png 1200w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin-150x58.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin-300x117.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin-768x298.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin-1320x513.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/advanced-excerpt-plugin-990x385.png 990w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div><p>Check out our other article on <a href=\"\/ph\/tutorials\/wordpress\/how-to-install-wordpress-plugins\">how to install plugins<\/a> for a complete tutorial.<\/p><p>To use the plugin, follow the guide below:<\/p><ol class=\"wp-block-list\">\n<li>Go to the <strong>Plugins<\/strong> tab and press <strong>Settings<\/strong> under the plugin.<br><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/plugin-settings.png\"><img decoding=\"async\" class=\"aligncenter wp-image-18789 size-full\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/plugin-settings.png\" alt=\"WordPress excerpt plugin settings.\" width=\"900\" height=\"216\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/plugin-settings.png 900w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/plugin-settings-150x36.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/plugin-settings-300x72.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/plugin-settings-768x184.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/a><\/li>\n\n\n\n<li>Customize the available options to your liking.<br><img decoding=\"async\" class=\"aligncenter wp-image-18790 size-full\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/09\/Advanced-excerpt.png\" alt=\"Customizing Advanced Excerpt plugin's settings.\" width=\"900\" height=\"570\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/Advanced-excerpt.png 900w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/Advanced-excerpt-150x95.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/Advanced-excerpt-300x190.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/09\/Advanced-excerpt-768x486.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/li>\n\n\n\n<li>Click the <strong>Save Changes<\/strong> button.<\/li>\n<\/ol><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner-1024x300.png\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-1024x300.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-768x225.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner-1536x450.png 1536w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2024\/06\/New-WP_in-text-banner.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>One of the points that contribute to triggering a reader&rsquo;s curiosity towards an article is the excerpt. When using WordPress, you can change the default excerpt length in two ways:<\/p><ol class=\"wp-block-list\">\n<li><strong>Manually<\/strong> &#8210; inserting code into the <strong>function.php<\/strong> file of a theme.<\/li>\n\n\n\n<li><strong>Using a plugin<\/strong> &#8210; installing the Advanced Excerpt plugin and configuring its settings.<\/li>\n<\/ol><p>Happy editing!<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">More Advanced WordPress Tutorials<\/h4>\n                    <p><a href=\"\/ph\/tutorials\/how-to-hide-page-title-wordpress\">How to Hide Page Title<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-add-custom-fonts-to-wordpress\">How to Add Custom Fonts<\/a><br>\n<a href=\"\/ph\/tutorials\/change-font-size-in-wordpress\">How to Change Font Size<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-custom-fields\">WordPress Custom Fields<\/a><br>\n<a href=\"\/ph\/tutorials\/wordpress-button-shortcode\">WordPress Button Shortcode<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&rsquo;re a WordPress user, you already know that the theme and WordPress core automates a lot of the features that dictate how your content is displayed. A common example is how pages display excerpts of your articles. But did you know that you can customize the WordPress excerpt length? This tutorial will explain how [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/wordpress-excerpt-length\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"WordPress Excerpt Length: What It Is and How to Change It","rank_math_description":"In this guide, you will learn how you can change your WordPress excerpt length using two methods \u2013 changing it manually or using a plugin.","rank_math_focus_keyword":"wordpress excerpt length","footnotes":""},"categories":[],"tags":[],"class_list":["post-18778","post","type-post","status-publish","format-standard","hentry"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/wordpress-excerpt-length","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/longitud-excerpt-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/excerpt-wordpress","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/wordpress-excerpt-length\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/wordpress-excerpt-length\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/wordpress-excerpt-length\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/longitud-excerpt-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/longitud-excerpt-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/longitud-excerpt-wordpress","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/wordpress-excerpt-length\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/wordpress-excerpt-length","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/wordpress-excerpt-length","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/wordpress-excerpt-length","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/18778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=18778"}],"version-history":[{"count":38,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/18778\/revisions"}],"predecessor-version":[{"id":93249,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/18778\/revisions\/93249"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=18778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=18778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=18778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}