How to add an “Excerpt” field to pages in WordPress
To add an “Excerpt” field to pages in WordPress, follow these step-by-step instructions:
Step 1: Log in to your WordPress Admin Dashboard
- Go to your WordPress website’s login page, typically found at
example.com/wp-admin
. Replacing example.com with your domain name. - Enter your username and password to log in.
Step 2: Enable Excerpts for Pages
By default, WordPress doesn’t display the excerpt field on pages, but you can enable it.
- Go to Pages:
- In the WordPress admin dashboard, on the left-hand side menu, click on Pages.
- Edit a Page:
- Open any existing page for which you want to enable the excerpt field by clicking on the page title, or create a new page by clicking Add New.
- Show Excerpt Option:
- In the page editor, at the top right of the screen, click on the Screen Options tab. This will open a dropdown of available options.
- In the dropdown, check the box next to Excerpt. This will enable the excerpt field to appear in the editor.
Step 3: Add Your Excerpt
- Scroll down on the page editor, and you should now see a new field called Excerpt.
- In the Excerpt field, write a short summary or description of the page’s content. This excerpt can be used in themes or plugins to display a custom summary for pages.
Step 4: Save Your Changes
- Once you’ve added your excerpt, scroll back up and click Update (or Publish, if it’s a new page) to save your changes.
Step 5: Customize Display (Optional)
If your theme or widgets don’t automatically show the excerpt, you may need to customize the theme or use a plugin to display the excerpt on pages. Here’s how:
- Check if the Theme Supports Excerpts for Pages: Some themes only display excerpts on posts, not pages. If this is the case, you may need to modify your theme files to display excerpts for pages.
- Use a Plugin:
- If modifying the theme isn’t ideal, you can use a plugin such as Advanced Excerpt to customize how and where the excerpts are shown across your site.
Step 6: Display Excerpts Using Code (Optional)
If you’re comfortable editing your theme files, you can modify how pages display the excerpt by editing the relevant .php
files in your theme.
- Access your theme files:
- Go to Appearance > Theme File Editor or use an FTP client to access your theme files.
- Modify the Template:
- Locate the template file responsible for displaying pages (typically
page.php
orcontent-page.php
). - Add the following PHP code where you want the excerpt to display:
the_excerpt();
- Save the changes.
- Locate the template file responsible for displaying pages (typically
Step 7: Clear Cache (If Applicable)
If you have a caching plugin installed, make sure to clear the cache so your changes are reflected immediately.
That’s it! You’ve now added and enabled the excerpt field for pages in WordPress.