Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

Add Excerpts to Your Pages in WordPress

Last updated on by
Elegant Themes
Add Excerpts to Your Pages in WordPress

In WordPress excerpts seem to be a feature exclusively for posts. But some users might want to use it for Pages as well. Even though WordPress supports Page excerpts internally as it has the same database field as the post excerpts, it provides no option to add excerpts to pages through the WordPress admin panel. In this article we will share a plugin that adds an excerpt box for your pages similar to the one for your posts.

Open your theme’s functions.php file and add the following code:

add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
     add_post_type_support( 'page', 'excerpt' );
}

Alternatively, you can install a plugin called PJW Page Excerpt which will add the same excerpt box to your page editor like your post editor has.

Add Excerpts to Your Pages in WordPress

PJW Page Excerpt


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Real name says:

    Tank’s

    codex.wordpress.org/Function_Reference/add_post_type_support#Example

  2. Julio says:

    Thanks! worked perfectly

  3. Dave Andrew says:

    Worked a treat. Thanks for the post.

  4. Owen says:

    Thanks your sharing :)

  5. Lins says:

    Thanks, super-handy & works easily. :)

  6. syndrael says:

    Thanks it works..

  7. Alastair Barnett says:

    Hello,

    I posted the above code to my functions php. I now cannot access my website. Here is the message I receive:Parse error: syntax error, unexpected T_FUNCTION in /home/content/94/8738594/html/wp-content/themes/associate/functions.php on line 82

    Please tell me how I can access my website in order to delete this code. Thanks if you can help. I’ve just lost my website and in a bit of a panic. Website address: http://www.thewritingbutler.com
    AB

  8. WK says:

    Added the code to my functions.php to enable excerpts on my pages.

    Worked perfectly, first time – thanks.

    W.

  9. mebhuwan says:

    Thank you for posting. Great Code. :)

  10. mattrock says:

    A very handy function. Thanks for posting!

  11. DanS says:

    Brilliant, thank you

  12. softboxkid says:

    no need any plugins… just place this add_post_type_support( 'page', 'excerpt' );
    to your functions.php

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.