How Does WordPress Search Work (+ Tips to Make It Better)

Do you want to learn how WordPress search works, and how you can make it better?

By understanding and improving the built-in WordPress search, you can help visitors find what they’re looking for. This can get you more conversions while keeping people on your site for longer.

In this article, we’ll look at how the default WordPress search works, and share tips on how to make it better.

How does WordPress search work + tips to make It better

How Does WordPress Search Work?

WordPress comes with a search system that will look for content within your website.

How the search bar looks and where it appears will vary depending on your WordPress theme, but most themes show the search bar in the top right corner.

The built-in WordPress search bar

Note: If your theme doesn’t show the WordPress search bar by default, then skip ahead to our FAQs, where we’ll show you how to add it.

Visitors can type a search query into this field, and WordPress will search:

  • Page titles
  • Page content
  • Single-image titles and captions
  • Image alt text
  • File names

As you can see, it doesn’t search widgets, user comments, categories, tags, WooCommerce products, or PDF documents. It also doesn’t search image gallery titles, captions, or alt text, although you can search this content using a search engine plugin like SearchWP.

WordPress performs this search using the WP_Query class. It will start by displaying any posts that have the search term in the post title, arranged in reverse-chronological order, meaning that the newest entries will be displayed at the top of the results.

After that, it’ll show any posts that have the matching term in the post content.

For example, imagine you’ve just published a post about cats titled ‘My Favorite Pet’, and you also have an older post titled ‘Best Cat Photos.’ In this case, searching for ‘Cat’ will display the older ‘Best Cat Photos’ post first, since it has the search term in the title.

This may not a problem for WordPress blogs or websites that only have small amounts of content. However, this ordering logic will often show inaccurate or confusing results for bigger blogs, online stores, or business websites.

The built-in system is also missing some of the features that people expect from modern search engines. This includes autocomplete, live Ajax search, filtering, and spellcheck.

Why Improve the Default WordPress Search?

An advanced, fast, and accurate on-site search can help visitors find interesting and relevant content, which will keep them on your website for longer. This can increase pageviews and reduce bounce rate in WordPress.

Since visitors are spending more time on your site, this will send positive signals to the search engines. This can improve your WordPress SEO, which means search engines like Google will show your content to more people and drive more visitors to your website.

For more information, please see our guide on how to increase your blog traffic.

People who are using your site’s internal search are already highly engaged. They’re actively looking for specific content, which may mean they’re ready to take actions such as buying a product, signing up to your WordPress membership site, or booking an appointment.

If these people can’t find what they’re looking for, they may give up and go to a different website. This means you’re losing out on visitors who were ready to convert.

A search results page is also an example of personalized content since you’re showing the visitor results that match their unique search query. By providing personalized content that’s accurate and helpful, you can improve the visitor experience. Once again, this can encourage them to convert.

Performance is another reason why it’s a good idea to replace the default WordPress search with a better alternative.

The larger your WordPress website gets, the longer it’ll take WP_Query to scan your database and get the results. This means your site’s search will get slower, as your website gets bigger.

How to Make the WordPress Native Search Better

On-site search helps visitors find what they’re looking for, including products to buy and interesting blogs to read. Since it’s such an important part of your site, it’s a bad idea to rely on the limited built-in WordPress search.

With that being said, let’s see how you can improve the native WordPress search.

Show Instant Results With Live Ajax Search

Live Ajax search adds a dropdown and autocomplete feature that’s common in search engines like Google.

As the user types, live search guesses what they want to search for and then shows them results without even reloading the page.

How to improve WordPress search with live ajax results

This can help visitors find the right content, without having to manually press the ‘Search’ button or wait for the page to reload.

The easiest way to add Ajax live search to WordPress is using the free SearchWP Live Ajax Lite Search plugin. It enables instant search automatically and there are no settings for you to configure, so it’s very easy to set up.

The first thing you need to do is install and activate the plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, the default WordPress search form will automatically use the Ajax live search feature. If you visit your site and start typing into the search bar, then you’ll see the instant search in action.

Change the Default Search URL Slug

By default, WordPress search URLs typically look something like this:

http://example.com/?s=search-term

The extra ?s= characters make this URL more difficult to read and understand, which can confuse visitors who are trying to find their way around your site.

Even worse, these URLs aren’t optimized for search engines which can stop them from correctly indexing your site’s contents.

The easiest way to change these URLs is by adding custom code to WordPress using a plugin such as WPCode.

You can go ahead and use the following custom code to replace the ‘/?s=search-term’ characters with ‘search.’ Your slug will look something like this when finished: http://example.com/search/wordpress

To use something other than ‘search’ in your URL, simply customize the code snippet below.

function wpb_change_search_url() {
    if ( is_search() && ! empty( $_GET['s'] ) ) {
        wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
        exit();
    }
}
add_action( 'template_redirect', 'wpb_change_search_url' );

For detailed instructions on how to insert this code to your WordPress website, please see our guide on how to change the default search URL slug in WordPress.

Make PDF Files Searchable in WordPress

By uploading PDFs to your WordPress website, you can share information about your services and products in a format that works on all devices. They’re also perfect for offering your visitors ebooks, user manuals, menus, and more.

However, WordPress only searches the contents of its database by default, so it will only look at the title and description of your PDF files, and not their contents. As a result, your visitors may struggle to find the best PDF for their search query.

The good news is that you can use a custom search plugin to improve the default WordPress search experience. If your PDFs are unencrypted, then the right search plugin will index the contents and metadata of your PDFs and add them to the search results.

For step-by-step instructions, please see our guide on how to add PDF indexing and searching in WordPress.

Add a Search By Category Feature to WordPress

If you have multiple categories of content on your website, then you might want to let users restrict their search to a specific category. This can help visitors find the right content, faster.

An example of search by category on a WordPress website

For example, if you have an online store then it often makes sense to let customers search within a particular product category.

If you run a membership site, then you might use search by category to help visitors find other members, groups, forums, online courses, and other specific kinds of content. For more information, please see our guide on how to add search by category in WordPress.

Make a Smart WooCommerce Product Search

WooCommerce has its own built-in search, but it doesn’t look for matches in product attributes, reviews, or product descriptions. This omission can stop shoppers from finding products they want to buy on your online store, so you get fewer sales.

The built-in WooCommerce search feature

Luckily, there are some excellent WooCommerce plugins that can show more helpful search results, and fetch them faster. To learn more, please see our guide on how to make a smart WooCommerce product search.

To get even more sales, you may want to fine-tune the kind of products WooCommerce includes in its search results. For example, you might only show products that are on sale or come with free shipping.

To learn more, please see our guide on how to customize WooCommerce product search results page.

Create a Search Form for Custom Post Types

Custom post types allow you to go beyond posts and pages and create different content types for your website. Custom post types can have different custom fields and their own custom category structure.

For example, if you run a movie review website, then you would probably want to create a ‘movie reviews’ post type that has fields for the director, release date, and more.

At WPBeginner, we use custom post types for our Glossary section to keep it separate from our blog posts.

How to improve your WordPress search with searchable categories

If you use custom post types, then you may want to create a form that allows visitors to search only that content.

For example, we also have a form that only searches WPBeginner’s coupon codes.

Searching coupons and deals on the WPBeginner website

This can help visitors find the right content faster, even when you have lots of different content types. For step-by-step instructions, check out our guide on how to create advanced search forms in WordPress for custom post types.

You can also make custom fields searchable in WordPress, which is ideal if you’ve added extra metadata to your pages and posts.

Exclude Content From WordPress search

By default, the built-in WordPress search will include all posts and pages in its search results.

However, you may want to exclude certain pages and posts from the search results. For example, if you’re running a WordPress membership website or selling online courses, then you’ll typically want to exclude your premium content from public search results.

If you’re running an online store, then you may want to hide content like your account page, checkout page, and thank you page. To help you out, we’ve created a guide on how to exclude pages from the WordPress search results.

Do you want to exclude posts, authors, custom post types, categories, tags, or even custom taxonomies? Then you can take a look at our guide on how to exclude specific pages, authors, and more from WordPress search.

WordPress Search FAQs

In this guide, we’ve explored how the default WordPress search works and shared lots of tips on how to improve it.

However, you may still have some questions about this important feature. That said, here are some of the most frequently asked questions about WordPress search.

How Do I Improve WordPress Search?

The best way to improve the built-in WordPress search is by using SearchWP.

SearchWP is the best custom search plugin for WordPress and allows visitors to search any content on your site including documents, WooCommerce products, custom fields, tags, comments, and more.

It also lets you customize the WordPress search algorithm, so you can control exactly where the content appears in the search results.

For more information, please see our guide on how to improve WordPress search.

Does WordPress Search Include Tags?

By default, WordPress search doesn’t include tags. The easiest way to make tags searchable is by using a custom search plugin like SearchWP.

SearchWP also has a relevancy slider, so you can control exactly how much tags influence where an item appears in the search results.

How Do I Add Search to My WordPress Theme?

If your theme doesn’t have a built-in search form, then we recommend adding a search bar to the WordPress navigation menu.

Since the main navigation menu typically appears across your entire site, visitors will be able to search for pages, posts, products, and more, from any page of your website.

An example of a search bar, in a navigation menu

If you’re using a block-based theme such as ThemeIsle’s Hestia Pro or Twenty Twenty-Three, then you can add a search bar to your theme using the full-site editor (FSE).

To do this, go to Appearance » Editor in the WordPress dashboard.

Opening the WordPress full site editor (FSE)

By default, the editor will show your theme’s home template. If you want to add the search bar to a different template, then click on the small arrow icon in the toolbar.

Then, select ‘Browse all templates.’

How to browse all FSE templates in WordPress

You’ll now see all the templates that make up your WordPress theme. Simply find the template where you want to add the search bar, and then click on its title.

For example, if you wanted to add a search form in your WordPress posts then you’d select the ‘Single’ template.

How to add the search bar to a single template in WordPress

You will now see this template in the full-site editor.

To go ahead and add a search bar, click on the blue ‘+’ icon.

Adding widgets to a single template in WordPress

In the popup that appears, type in ‘Search’ to find the right block.

You can then drag the block to the location where you want to show the search bar.

Adding a search block to a block-enabled theme template

To customize the block title or placeholder text, simply type it into the search block where it says ‘search’ or ‘optional placeholder.’

When you’re happy with how the block looks, click on ‘Save’ to make the search bar live.

Publishing a block-enabled template with a search bar

How Do I Add Search to a WordPress Page or Post?

You can add a search bar to a specific page or post using the built-in Search block.

This is a good choice if you want to control exactly where the search bar appears on every page and post, or you only need to offer search on specific areas of your website.

How to improve the default WordPress search

To get started, simply open the page where you want to add a search form and then click on the + icon.

In the popup that appears, type ‘Search’ to find the right block. Once you click on the Search block, it will add the block to your page.

Adding the Search block to a WordPress page or post

By default, the block uses ‘Search’ for both its label and the button text.

This will be visible to visitors, so you may want to replace it with something more descriptive by typing into the text fields.

Customizing the WordPress search block

You can also add some placeholder text to the search bar. This text will disappear automatically when the visitor starts typing.

To add a placeholder, simply click on ‘Optional placeholder…’ and then start typing.

How to improve the WordPress search

When you’re happy with how the Search block looks, you can go ahead and either publish or update the post.

We hope this tutorial helped you learn how WordPress search works, and how to make it better. You may also want to learn how to make money online blogging with WordPress, or check out our list of the best email marketing services for small businesses.

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 Does WordPress Search Work (+ Tips to Make It Better) first appeared on WPBeginner.

How to Enable Search by Product SKU in WooCommerce

Would you like your customers to be able to search for your WooCommerce products using a SKU code?

Because SKU codes uniquely identify your products, searching for them will help users quickly find exactly what they are looking for. The challenge is that SKU search is not enabled in WooCommerce by default.

In this article, we’ll show you how to enable search by product SKU in WooCommerce.

How to Enable Search by Product SKU in WooCommerce

Why Enable Search by Product SKU in WooCommerce?

To run a successful WooCommerce store, it’s important for your customers to easily find the products they wish to purchase. To make this simple, most eCommerce platforms use SKUs, or Stock Keeping Units, to uniquely identify each product.

If a customer knows the SKU for the product they wish to purchase, why not let them search for the SKU to instantly find the correct product in your store?

The problem is that WooCommerce SKUs are stored in custom fields, and these are not indexed or included in search results by default. As a result, searching for the SKU won’t help.

Let’s take a look at how to solve this problem by enabling users to search by SKU in WooCommerce using a product search plugin.

How to Enable Search by Product SKU in WooCommerce

The first thing you need to do is install and activate the SearchWP plugin. You’ll need at least the Pro plan to access WooCommerce integration. For more details, see our step-by-step guide on how to install a WordPress plugin.

SearchWP is the best custom search plugin for WordPress and is used by over 30,000 websites. It lets you customize the search algorithm, add live Ajax search for real-time results, and more.

Upon activation, you need to visit the SearchWP » Settings page and switch to the ‘Support’ tab to enter your license key. You can find it in your downloads area for your account on the SearchWP site.

Paste Your SearchWP License Key

Next, you need to install and activate the WooCommerce Integration extension for SearchWP.

You’ll find this in the downloads area for your account on the SearchWP website, too. You should install it as you would install any other WordPress plugin.

Install the WooCommerce Integration Extension

Now you are ready to customize the SearchWP search engine to index your product SKUs.

Simply go to the SearchWP » Settings page and make sure you’re on the ‘Engines’ tab. Once there, you need to click the ‘Sources & Settings’ button.

Click on the 'Sources & Settings' Button

This will bring up a popup where you should make sure the checkbox next to ‘Products’ is checked. This will allow SearchWP to index your WooCommerce products.

Also, if you’d also like to include WooCommerce product reviews in your search results, then make sure you check the ‘Comments’ box, too. That’s because product reviews are actually stored as comments in WooCommerce.

Check the Products and Comments Boxes

Once you’ve done that, click on the ‘Done’ button to close the popup and get ready to add the SKU search.

Now you need to scroll down to the ‘Products’ section. Notice that by default, the plugin will only look at the product title, content (description), slug, and excerpt (short description).

Click the 'Add/Remove Attributes' Button in the Products Section

You can extend SearchWP’s reach to include SKUs by clicking on the ‘Add/Remove Attributes’ button. This will bring up a popup where you can include specific custom fields and taxonomies in searches.

You’ll need to type ’SKU’ into the Custom Fields field and choose the _sku option from the dropdown menu. This will add SKUs to WooCommerce search results pages.

Select _sku From the Custom Field Drop Down Menu

You can now click the ‘Done’ button.

Notice that there is now a new section labeled ‘Custom Fields’ with the _sku field underneath.

Slide the SKU Relevance Slider to the Right

To begin with, the relevance slider will be set all the way to the left, which means that SKU search results will be given the lowest priority in search results.

Since SKUs are an important way to find your products, you should move the _sku slider all the way to the right, as you can see above.

When you’re done, go ahead and click on the ‘Save Engines’ button at the top of the screen to save your settings.

Click the 'Save Engine' Button

SearchWP will then start rebuilding your search index in the background. It may take a few minutes to complete, but after that, you will be able to search your WooCommerce store by product SKU.

SearchWP will automatically use any search forms on your online store, so there is no need to take any additional steps if you have them on your site already.

However, if you need to add a search form, then see our step-by-step guide on how to create a custom WordPress search form. This will also teach you how to style the results page using custom CSS.

Now you can go to your WooCommerce store to try out the search feature.

In our demo store, the long sleeve tee has the SKU ‘woo-long-sleeve-tee.’ When we search for that SKU, the correct product is displayed.

Preview of Product SKU Search in WooCommerce

To learn more about improving search on your online store, see our guide on how to make a smart WooCommerce product search.

We hope this tutorial helped you learn how to enable product search by SKU in WooCommerce. You may also want to learn how to create a WooCommerce popup to increase sales, or check out our list of the best WooCommerce plugins to grow your online store.

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 Enable Search by Product SKU in WooCommerce first appeared on WPBeginner.

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.