Help Center
How to Make the Custom URL for the Search Results Page

How to Make the Custom URL for the Search Results Page

Learn how to create custom URLs for search results pages on your WordPress website using the JetSearch plugin to enhance user experience and improve SEO.

Before you start, check the tutorial requirements:

  • Elementor (Free version), WordPress Block editor (Gutenberg), or Bricks

  • JetSearch plugin installed and activated

Ajax Search is a dynamic search field that uses AJAX (Asynchronous JavaScript and XML) to fetch search results in real-time as the user types in the search query without reloading the page.

By default, the Ajax Search widget/block/element redirects us to the default WordPress search results page.

To enhance user experience and SEO, you can create a custom page and attach its URL to the search results in the JetSearch plugin’s settings.

This tutorial provides step-by-step instructions on the example of a post and WooCommerce product search on a book e-commerce website.

Things to know

The provided tutorial is based on the OnlyBooks dynamic template.

Displaying Posts on the Search Results Page

To display the WordPress default posts on the Search Results page, we will create a Listing template, which will be displayed with the Listing Grid widget, block, or element provided by the JetEngine plugin. Such a listing can also be crafted for custom posts.

Create a Listing

Go to the WordPress Dashboard > JetEngine > Listings and hit the “Add New” button.

Select the “Posts” Listing source and the needed post type for the From post type field (“Posts,” in our case). Then, enter the Listing item name and choose the Listing view (it can be Elementor, Gutenberg, or Bricks).

Push the “Create Listing Item” button.

listing template for the search result page

On the editing page, you can customize the listing template using Dynamic Widgets, Blocks, and Elements.

For instance, we used the Dynamic Image widget with the “Post Thumbnail” Source to display the featured image.

dynamic image widget displays featured image

Then, we placed the Dynamic Terms widget with the “Categories” source to show the post category.

dynamic terms widget shows post category

We drag-n-dropped the Dynamic Link widget with the “Permalink” Source and “%title%” Label to display the post title with the permalink on the post.

dynamic link widget shows post title

The last two are Dynamic Meta widgets: the first displays the post author, and the second — the post date.

dynamic meta widgets with post author and post date

After you finish customizing the listing template, hit the “Update” button.

Create a Search Results page

Go to WordPress Dashboard > Pages > Add New Page, name the page, and choose the editor in which you want to craft it. For example, we hit the “Edit with Elementor” button.

We added the Listing Grid widget for which we set the recently created Listing. Also, we set the custom “No Posts Found” Not found message

listing grid widget with posts

Customize the page as needed and hit the “Publish/Update” button.

Attach the page to the search results settings

To copy the search results page URL, open the page on the front end or use another preferred way.

search results page URL

Navigate to the WordPress Dashboard > Crocoblock > JetPlugins Settings > JetSearch > Ajax Search Settings tab.

In the Ajax Search Widgets Default Query Settings section, set the needed post type as the Source (“Posts” in our case) and adjust other global settings if needed.

ajax search widgets default query settings source

Then, scroll down to the Custom Results Page section, enter the copied URL into the Custom Search Results URL field, and change the Search Query Param if you like.

Afterward, push the “Save Options” button.

custom search results URL

Set the Ajax Search widget, block, or element

Place the Ajax Search widget, block, or element on a page or template. If you did it, proceed to the page or template when it’s located to check its settings.

For example, we adjusted the Ajax Search widget in the header in the Elementor editor. To learn how to create a custom header, proceed to the How to Create a Custom WordPress Header tutorial. 

Also, you can check the How to Add an Ajax Search to the Website’s Header with the JetSearch tutorial.

Unfold the Search Query tab of the Content section and check if the global settings are applied to the widget/block/element settings.

In our case, the Custom Search Results URL and Source were pulled up successfully from the JetSearch plugin’s settings.

Warning

If the Ajax Search query settings differ from the Ajax Search Widgets Default Query Settings adjusted in the previous step, additional parameters will be added to the custom URL after searching on the front end. To improve SEO and user experience, ensure that the Search Query tab settings of the widget/block/element match the default settings and correct them if needed.

ajax search query settings

Now, you can adjust the Search Form, Results Area, and Custom Fields settings of the widget/block/element. Also, you can learn about the Search Suggestions feature.

When you are done, save the changes.

Check the results

Go to the front end and enter any request to check the results. 

ajax search on the front end

Instead of the default WordPress search results page, you will be redirected to the custom page with the Listing Grid

In our case, the URL looks like this:

http://localhost/onlybooks/search-results/?jet_search=milk&jsearch

where “jet_search” is the Search Query Param that can be changed WordPress Dashboard > Crocoblock > JetPlugins Settings > JetSearch > Ajax Search Settings > Custom Results Page section.

custom search results page

Displaying WooCommerce Products

Create a Search Results page and set a widget with products

Go to WordPress Dashboard > Pages > Add New Page or open the created one. The products can be displayed with the Products Grid or Products List widgets from the JetWooBuilder plugin or Listing Grid from the JetEngine plugin. We decided to use the Products List widget that is available only in Elementor, so we hit the “Edit with Elementor” button.

We placed the Products List widget with the default “Products” post type source. Learn its settings from the Products List Widget Overview. You can also use the Products Grid Widget.

For the search results page, you can customize the Not Found Message. For instance, we changed it to “No Books Found.”

products list widget with books

Customize the page as needed and hit the “Publish/Update” button.

Adjust the Ajax Search Settings

Copy the page URL (e.g., from the front end).

Proceed to the WordPress Dashboard > Crocoblock > JetPlugins Settings > JetSearch > Ajax Search Settings tab.

In the Ajax Search Widgets Default Query Settings section, set the needed post type as the Source (“Products” in our case) and adjust other global settings if needed.

Then, scroll down to the Custom Results Page section, enter the copied URL into the Custom Search Results URL field, and change the Search Query Param if you like.

Afterward, push the “Save Options” button.

Customize the Ajax Search widget/block/element

Place the Ajax Search widget, block, or element on a page or template, or proceed to the page where it’s already located. For example, it can be a custom header.

Unfold the Search Query tab of the Content section and check if the global settings are applied to the widget/block/element settings.

In our case, the Custom Search Results URL and Source were pulled up successfully from the JetSearch plugin’s settings.

Warning

If the Ajax Search query settings differ from the Ajax Search Widgets Default Query Settings configured in the previous step, additional parameters will be appended to the custom URL after a search is performed on the front end. To enhance SEO and user experience, ensure that the Search Query tab settings for the widget/block/element match the default settings and make corrections if necessary.

ajax search query default settings

Adjust other Ajax Search settings and save the changes.

Checking the results

Eventually, head to the front end and enter any request to check the results. Instead of the default WordPress search results page, you will be redirected to the custom page with the Products List or Products Grid

The URL looks like this:

http://localhost/onlybooks/search-results/?jet_search=great&jsearch

where “jet_search” is the Search Query Param that can be changed WordPress Dashboard > Crocoblock > JetPlugins Settings > JetSearch > Ajax Search Settings > Custom Results Page section.

custom search results page with products list

That’s all. Now you know how to create custom URLs for search results pages on your WordPress website using the JetSearch plugin.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.