SearchWP Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to display excerpts on WordPress results page

Every website owner knows the frustration of a basic WordPress search that has limited capabilities and lack of control when it comes to showing search results. 

To enhance the search experience, adding excerpts to WordPress search results transforms how users interact with your site’s search function.

Instead of seeing just titles and a few lines from the introduction, visitors get preview text that helps them decide if a result matches what they’re looking for.

In this article, we’ll show you how to display excerpts on the WordPress search results page.

Why Add Excerpts to WordPress Search Results?

Depending on your website theme, the default WordPress search shows the first few lines of your content in the search results. This means that even if someone searches for a term that appears in the middle of your post, they’ll only see the beginning text that might not include key information they’re looking for.

Search results with excerpts give users a preview of the content before they click. This saves them time and helps them make better decisions about which results to explore.

Think of search excerpts like movie trailers. Just as a good trailer shows the most relevant scenes to attract viewers, a good search excerpt should show the most relevant parts of your content that match what people are searching for.

Adding excerpts to search results also helps prevent the frustrating experience of clicking back and forth between results. Users can scan the excerpts to find exactly what they need without loading multiple pages.

That said, let’s look at how you can easily show excerpts on the search results page on your site.

Adding Excerpts to WordPress Search Results Page

One of the ways to display excerpts below search results is by customizing your WordPress website theme.

However, this method can be tricky for users, as it may involve hiring a developer.

An easier way to show excerpts for each search result is by using SearchWP.

SearchWP

It is the best search plugin for WordPress that is beginner-friendly to use and helps transform the default WordPress search.

SearchWP comes with pre-built templates for search results page. You can customize it to show descriptions for your products or excerpts for blog posts, and more.

The plugin also lets you connect the results page with custom search forms, so you get complete control on how search works on your site.

Another benefit of using SearchWP is that you can include custom fields, categories, tags, product details, documents, PDFs, and other additional information in the search process.

With that, let’s look at how you can display excerpts in search results.

Step 1: Install and Activate SearchWP Plugin

First, you’ll need to visit the SearchWP website and sign up for a new account.

Once done, simply navigate to your SearchWP account and go over to the Downloads tab.

Download SearchWP plugin from account area

Next, you can press the Download SearchWP button and save the plugin’s ZIP file to your computer.

After that, you should also copy your license key, as you’ll need it further to activate the plugin.

When you finish downloading, the next step is to upload the SearchWP plugin’s ZIP file to your site.

If you need help with this, then check out the how to install a WordPress plugin step-by-step guide.

Upon activation, you’ll see the SearchWP welcome screen. Go ahead and click the ‘Start Onboarding Wizard’ button and follow the steps in the wizard.

Onboarding wizard SearchWP

Now that SearchWP is set up on your site, the next step is to create a results page template.

Step 2: Customize the Results Page Template

To start, you’ll need to go to SearchWP » Templates from the WordPress dashboard.

Here, you can edit the default results page that will appear on your website or create a new one by clicking the ‘Add New’ button.

Edit templates page in SearchWP

For this tutorial, we’ll go ahead and add a new results page template.

Next, you can start by editing the name at the top and then choosing a layout theme for your results page.

Choose a search results template

SearchWP offers 6 pre-built themes, each with different layouts. You can pick a minimal theme with title and excerpt or one that shows the featured image.

The best part is that you also get to see a preview of the page, so you can easily select the layout that you like.

View preview of results page template

Next, you can scroll down to the ‘Custom Styling’ section and further customize your search results page.

When you change the layout style, ensure that the Description option is enabled to show excerpts. Besides that, you can also edit the title style, change the button style, and more.

Change custom styling options

When you’re done customizing the theme, scroll to the top and click the ‘Save’ button to store your changes.

From here, you’ll need to click the Embed button.

Save and embed your results page

After that, you should see a popup window open. Here, you will need to choose how to embed the results template (Gutenberg block, shortcode, or PHP code) and where you’d like to embed it.

For instance, we’ll select the ‘Gutenberg Block’ option and embed it by creating a new page.

Choose how to embed results page

Next, you will need to enter a name for the new page.

Once that’s done, simply click the Let’s Go button.

Enter name for new results template page

After that, you will view the results template in the content editor.

Do note that you won’t see the search results preview right away. You’ll first need to connect it to a search form.

See preview and publish page

Go ahead and Publish your page.

Step 3: Point a Search Form to Results Template Page

The next step is to make sure your search form points to the new search results page you just created.

The best part about using SearchWP is that you can create unlimited search forms, connect them to custom search engines, and point them to a custom search results page.

To start, simply head to SearchWP » Search Forms page from the admin panel. Here, you can select an existing search form or add a new one.

Add a new search form

On the next screen, you’ll need to select the layout theme for your search form.

SearchWP offers pre-built templates, which you can easily customize.

Select search form layout

After that, you’ll need to scroll down to the Custom Styling section.

Here, make sure to set the Results Page to SearchWP, Target Page to the results page you created earlier (Excerpt Results Page in our example), and Template to the results template you added in the previous step.

Change template and results page options

When you’re done, simply click the Save button at the top.

From here, you can go ahead and embed the form on your website.

Save and embed category form

If you want to learn more, then please see our guide on how to create a custom search form in WordPress.

Step 4: Test and See if Excerpts Appear on Search Results Page

Once you’ve added the new search form to your site, the next thing to do is test if it is working correctly.

To do that, simply visit your website and search for a blog post that has an excerpt.

Note: If you’re not sure where to add an excerpt in the content, then you may want to see this guide on how to easily add post excerpts to your WordPress theme.

For example, when we search for a blog post that had an excerpt using the search form on our test site, the results page showed the title of the post along with the excerpt under it.

Search for posts with excerpt

That it! You’ve now successfully added excerpts on the search results page.

We hope this article helped you learn how to display excerpts on the WordPress search results page. You may also want to see our guide on how to fix custom post type search not working and how to customize your WordPress search results page.

If you’re ready to gain full control over how search works on your WordPress site, then you can get started with SearchWP today.

author avatar
Aazim Akhtar

Create a Better WordPress Search Experience Today

Never lose visitors to unhelpful search results again. SearchWP makes creating your own smart WordPress search fast and easy.

Get SearchWP Now
Multiple Search Engines Icon