How to Customize the Search Results Page in WordPress

Do you want to customize the search results page on your WordPress website?

The search results page can help users find the content they are looking for. Customizing it will improve the user experience on your site, which can lead to more page views and conversions.

In this article, we will show you how to easily customize the search results page in WordPress without writing any code.

Customizing WordPress search results page

Why Customize the WordPress Search Results Page?

By default, your WordPress website comes with a basic search feature. It allows users to look for content matching their search terms, but the search results are not very good.

No results found for a search term in WordPress

Often, search terms return no results, even when there are possibly several matches that would answer the user’s query.

The search itself is also slow and requires a page load. If multiple users end up using the search feature at once, then this could slow down your website.

By customizing your search results page in WordPress, you can create a faster search system with a better user experience and more helpful search results.

Search results found

Sounds good? Let’s get started.

Step 1: Setting Up SearchWP as Your WordPress Search Engine

SearchWP is the best WordPress search plugin on the market. It allows you to improve WordPress search by replacing it with a faster and more accurate search engine.

SearchWP Homepage

It automatically indexes your content in the background, which allows searches to run faster. You don’t need to replace the default WordPress search forms and templates.

First, you need to install and activate the SearchWP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the SearchWP » Settings page and switch to the ‘License’ tab. Enter your plugin license key, which you can find in your account on the SearchWP website.

Enter SearchWP license key

Next, you need to visit the SearchWP » Algorithm page to configure the search engine settings.

You will notice that SearchWP has set up a default search engine for you. It uses your WordPress posts, pages, and media as sources.

SearchWP search engines

Under each source, you can adjust the sliders to give more relevance to one attribute than another.

Want to include more places on your website in search results? Just click on the ‘Sources & Settings’ button to add them.

Add sources to search engine

For the sake of this tutorial, let’s add Comments as a search source.

After you click ‘Done’, a new tab will appear under the sources list. However, it will be empty, and to make it useful, you need to click on the ‘Add/Remove Attributes’ button.

Add attributes

This will bring up a popup where you can select which attributes you want to include in your search.

For instance, we picked Comment text as an attribute.

Select attributes to add into search source

After adding an attribute, you can assign a weight to it in your search results.

More weight means that SearchWP will consider that attribute more relevant than other attributes when showing search results.

Attribute weight in search results

Just repeat the process if you need to add more attributes to a source.

Once you have finished reviewing search sources, you can go ahead and click on the ‘Save’ button.

Save search engine settings

SearchWP will now start building a search index based on your settings.

Once finished, you will see 100% as the Index Status.

Search index status in SearchWP

The SearchWP engine will now automatically replace the default WordPress search. If you already have a search form on your website, then you can try it.

If you don’t have a search form on your website, then you can add one by visiting the Appearance » Widgets page.

Simply add the Search widget or block to your sidebar and click on the ‘Update’ button to save your changes.

Add a search widget block

Note: If your WordPress theme does not have any widget-ready areas, then you will not see the Widgets page under the Appearance menu.

Instead, you can add a Search block to your site by visiting the Appearance » Editor page.

Search block in site editor

This will launch the full site editor. You can add the Search block to any place where you want the search form to be displayed.

You can now visit your WordPress blog and try out your new and improved search feature.

Step 2: Creating Advanced Search Forms for Your WordPress Site

A plain search form looks okay and gets the job done. However, it is not very engaging, and users often don’t even notice it on a site.

SearchWP fixes this by allowing you to create highly useful and advanced search forms for your WordPress site.

Simply go to the SearchWP » Search Forms page and click the ‘Add New’ button.

Search forms in SearchWP

On the next screen, click on the pencil icon next to the form name to give it a proper name.

This will help you recognize the form when you need to add it to your site later.

Give your form a name

After that, you must choose a theme for your search form.

SearchWP comes with several options, including Basic, Category Search, Quick Search, Advanced, and Combined search forms.

Search form themes

Clicking on a theme will select it and show you a preview of what that search form would look like.

Simply pick a theme you would like to use for your search form and then scroll down to customize it.

Customize your search form

From here, you can tweak the form settings, style your form, and choose colors.

Once you are finished, don’t forget to click the ‘Save’ button to store your settings.

Save search form

Note that this custom form will not automatically replace your default WordPress search form.

Instead, you will need to manually embed it on your site. Simply go to the Appearance » Widgets page (or Appearance » Editor if your WordPress theme doesn’t have sidebars).

From here, you need to add the Search Form block to your widget area or template in the site editor.

Search form block

After that, choose the form you just created from the dropdown menu inside the block.

You will then see a preview of your custom search form on the screen.

Advanced form displayed

Don’t forget to click on the ‘Save’ or ‘Update’ button to store your changes.

Step 3: Adjusting the Search Results to Promote Important Content

Now that you have replaced the default WordPress search with SearchWP, it is time to look at how you can generate even better search results.

We will start by promoting important content in search results. These could be blog posts that bring you more revenue, sales pages, lead-generation landing pages, and more.

First, you need to visit the SearchWP » Extensions page and install the Custom Results Order extension.

Custom Results Order extension for SearchWP

Next, you need to visit the SearchWP » Statistics page.

Here, you can see which search terms or keywords are popular among your users.

SearchWP statistics

Note: If you have just installed the plugin, then you may not have enough data here. You can wait for users to enter a few search terms to collect more data.

Now, look for the keywords where you want to promote a particular post and page in the search results.

After that, go to the SearchWP » Algorithm page and select the ‘Custom Results Order’ tab.

Add custom results order

Enter the keyword for the post or page that you want to promote inside the search query box, then click the ‘Add Search Query’ button.

SearchWP will show you the results for that particular query. You need to select the content you want to promote and then click the ‘Promote to Top’ button.

Promote to top

Your selected post or page will now start appearing at the top for that particular search keyword.

You can always return to the same page and unpin that post or page from the top by clicking on the ‘Remove Promotion’ button or perhaps adding a different one.

Promoted search result

Step 4: Exclude Content From WordPress Search Results

Sometimes, you may have content you don’t want to appear in search results. For instance, you might have a page promoting an expired sales event or an outdated blog post.

SearchWP allows you to easily exclude any post or page you don’t want to include in search results.

First, you need to visit the SearchWP » Extensions page and install the Exclude UI extension.

Exclude UI extension

After activation, you can simply edit the post or page you want to exclude from search results.

In the ‘Post’ panel on the edit screen, you will now see an option to exclude that post from search results.

Exclude post from search results

Simply check the box next to ‘Exclude from search’ and click on the ‘Update’ button to save your changes.

SearchWP will now stop showing that post or page in search results.

Step 5: Make Search Results Appear Instantly in WordPress

Normally, your SearchWP search results will appear using the theme template file provided by your WordPress theme.

But what if you could show the users the results as soon as they start typing? This feature is called live search, and you may have already seen it on search engines like Google and Bing.

Let’s add live search to your WordPress site to make search a better experience for your users.

First, you need to visit the SearchWP » Extensions page and install the Live Search extension.

Install live ajax search

Upon activation, the extension will start working automatically.

You can now go to your website and start typing keywords into a search form to see it in action.

Live search preview

For more detailed instructions, you can see our tutorial on how to add live search in WordPress.

Step 6: Search in More Places on Your WordPress Site

SearchWP can be configured to search in more places on your WordPress website. For instance, it can search in custom fields, PDF documents, shortcode outputs, and more.

Depending on where you want to enable search, you can turn these features on and off as needed.

Enable Search for WordPress Custom Fields

WordPress custom fields allow you to store additional metadata for your WordPress posts and pages. They are also used by WordPress plugins to store data related to a post or page.

To include custom fields in your search sources, just go to the SearchWP » Algorithm page and click the ‘Add/Remove Attributes’ button below a source.

Edit search source attributes

This will bring up a popup where you can select a specific custom field or select any meta key.

Simply click on ‘Done’ when you are finished, and don’t forget to click the ‘Save Engines’ button.

Include custom fields in search results

SearchWP will now start using custom fields as a source and will include matching posts in the search results.

For more details, see our guide on how to make custom fields searchable in WordPress.

Enable Search in PDF and Documents

SearchWP can also search inside PDF files and office documents uploaded in your WordPress media library.

Simply go to the SearchWP » Algorithm page and click on your search engine’s ‘Sources & Settings’ button.

Search sources and settings

This will bring up a popup where you need to make sure that ‘Media’ is selected as one of the sources.

Then, click the ‘Done’ button.

Select media source

After that, scroll down to the sources list on the Engine settings page to find the Media tab.

From here, you need to click on the ‘Add/Remove Attributes’ button.

Add media attributes

This will bring up a popup where you can select which attributes you want to include in your search results.

Make sure that the Document Content, PDF metadata, and Title attributes are selected.

Select PDF document attributes

Simply click on the ‘Done’ button after making your selection.

Next, you can move the slider up and down to adjust the weight you want to give to a particular attribute in search results.

Once you are finished, don’t forget to click the ‘Save Engines’ button to save your settings.

Adjust PDF weight

Enable Search in Shortcode Outputs

Many WordPress plugins use shortcodes to output data in your WordPress posts and pages.

If this shortcode data is important for your WordPress website and will help improve search results, then you can enable Shortcode Output parsing in SearchWP.

Simply go to the SearchWP » Settings page and scroll towards the bottom. From here, you need to turn on the ‘Parse Shortcodes’ option.

Parse shortcodes

After that, you just need to click the ‘Wake Up Indexer’ button to run a new indexing process in the background that will include shortcode output in search results.

Step 7: Include eCommerce in WordPress Search Results

SearchWP makes it super easy to improve eCommerce search results in your online store.

It has powerful integrations for popular eCommerce plugins, including WooCommerce and Easy Digital Downloads.

We will show you how to turn it on for your WooCommerce store. Other integrations work similarly as well.

First, you need to go to the SearchWP » Extensions page and install the WooCommerce Integration extension.

WooCommerce integration in search results

Upon activation, go to the SearchWP » Algorithm page.

Then, click on the ‘Sources & Settings’ button for your search engine.

Search sources and settings

This will bring up a popup where you need to ensure that the ‘Products’ option is selected as one of the sources.

After that, click on ‘Done’ to exit the popup.

Add WooCommerce products to search

Now, scroll down on the Sources screen, and you will see the Products tab.

You can adjust the attribute weight by moving the sliders or clicking on the ‘Add/Remove Attributes’ button to select custom fields or product categories.

Product weight adjusted

Once finished, don’t forget to click the ‘Save Engines’ button to save your settings.

For more detailed instructions, you can read our guide on how to improve WooCommerce product search in WordPress.

We hope this article helped you learn how to easily customize the search results page in WordPress. You may also want to see our guide on how to track user journeys on WordPress lead forms and our expert picks of the best WordPress SEO plugins.

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.

The post How to Customize the Search Results Page in WordPress first appeared on WPBeginner.

How to Include Custom Post Types in WordPress Search Results

Do you want to include custom post types in WordPress search?

By default, WordPress will never show custom post types in its search results. That means your visitors may miss out on some great content, and you’ll miss out on extra page views.

In this article, we will show you how to include custom post types in WordPress search.

How to include custom post types in WordPress search

How to Include Custom Post Types in WordPress Search

Although WordPress has a built-in search feature, its quite limited. If you create custom post types in WordPress, then WordPress won’t include these items in search results.

The easiest way to include custom post types in WordPress search is by using the SearchWP plugin.

SearchWP is the best custom search plugin for WordPress, used by over 30,000 websites. It’s easy to use and lets you search content that isn’t included in the default WordPress search.

To include custom post types in WordPress search, you’ll need to install and activate SearchWP. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, click on the new ‘SearchWP’ button in your website’s toolbar. You can then go ahead and click on ‘Activate License.’

Activating the SearchWP WordPress plugin

After you’ve done that, click on the ‘License’ tab.

You can now paste your license key into the ‘License’ box. You’ll find this key in the email you got when you purchased SearchWP and in your account on the SearchWP site.

The SearchWP advanced search WordPress plugin

Once you’ve pasted this information into the ‘License’ field, go ahead and click on the ‘Activate’ button next to it.

You can now set up SearchWP to include custom post types in WordPress search results.

To start, simply click on the ‘Engines’ tab.

SearchWP's Engine tab

On this screen, you’ll see sections for the different types of content on your WordPress site that SearchWP includes in its search results.

By default, this plugin searches your website’s media, posts, and pages.

To include custom post types in your searches, click on the ‘Sources & Settings’ button.

Configuring the SearchWP search plugin

Under ‘Sources,’ you’ll see all your post types listed along with comments, media, and more. Simply find all of the custom post types that you want to include in your search results, and check their boxes.

After that, click on the ‘Done’ button.

Including custom post types in WordPress search

You’ll now see a new section for each of your custom post types on your WordPress blog.

In each section, SearchWP shows all the attributes that it will look at when searching your custom post types.

For each attribute, SearchWP has an ‘Applicable Attribute Relevance’ scale. This is the weight that SearchWP gives to this attribute when searching your custom post types.

By default, the sliders for Title, Slug, and Excerpt are all the way to the right, so they have the most weight. The slider for Content is in the center, so it has less weight.

SearchWP's attribute weight settings

Want to change an attribute’s weight? Simply drag its slider.

You may want to try different relevancy settings to see what gives you the most accurate and helpful search results.

You can also remove attributes. For example, your custom post type may have attributes that you want SearchWP to ignore, like attributes that you added for your internal reference only.

To add or remove attributes, click on the ‘Add/Remove Attributes’ button.

Adding custom post type attributes to WordPress search

To add an attribute, simply click to check its box.

If you want SearchWP to ignore an attribute, then go ahead and uncheck its box.

Removing custom post type attributes from WordPress search

If you’ve created any custom taxonomies or custom fields, then you might want SearchWP to look at this content when searching your custom post types.

To do this, simply click on either the ‘Custom Fields’ or ‘Taxonomies’ fields. You can then type in the name of the attribute that you want to add, and click on it when it appears.

Adding custom post types in WordPress search

When you’re happy with your settings, click on the ‘Done’ button.

If you’ve added any attributes, custom fields or taxonomies, then you can change how much weight this content has. Just like we mentioned earlier, moving the slider to the right will give this attribute more weight which means it will have a bigger impact on the search results.

Changing the attribute relevancy for custom post types in WordPress search

Once you’ve finished customizing SearchWP’s settings, scroll to the top of the screen.

You can then click on the ‘Save Engines’ button to save your changes.

Saving your WordPress custom search settings

At this point, SearchWP may show you the message ‘The index needs to be rebuilt.’

If you see this message, then go ahead and click on the ‘Rebuild Index’ button. This will add your custom post types to your site’s search index, so they will show up in the search results.

Rebuilding the WordPress search index

That’s it. WordPress will now include your custom post types in its search results.

Once you’ve done that, you may want to enable some advanced settings that will make it easier for visitors to find what they are looking for.

To take a look at these settings, click on the ‘Advanced’ tab.

SearchWP's advanced search settings

This screen lists some of the more advanced settings that you may want to use.

For example, if you want to show results that don’t quite match the term that the visitor searched for, then you can check the ‘Partial matches (fuzzy when necessary)’ box.

The 'fuzzy' partial search settings in SearchWP

For more tips on SearchWP’s advanced settings, please see our step by step guide on how to improve WordPress search with SearchWP.

After adding custom post types to WordPress search, you may want to create a search form that only show the search results from your custom post type category, which can make it easier for visitors to find what they’re looking for. For more details, see our step-by-step guide on how to create advanced search form in WordPress for custom post types.

We hope this article helped you learn how to include custom post types in WordPress search. You can also go through our guide on how to make money online blogging with WordPress, and see our expert pick of must have WordPress plugins for business sites.

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.

The post How to Include Custom Post Types in WordPress Search Results first appeared on WPBeginner.