Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Fix WordPress Search Not Working (5 Common Errors)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

WordPress comes with a default search feature, but sometimes, errors and limitations can get in the way.

When that happens, your visitors might struggle to find what they’re looking for, negatively impacting their experience on your site. In our experience, this can be one of the biggest reasons for people leaving your website.

In this guide, we will show you how to fix common problems with the WordPress search functionality to help you maintain a top-notch user experience.

How to fix WordPress search not working

Why Do WordPress Search Errors Happen?

Most websites have a search feature that helps visitors find interesting content on your WordPress blog or products that they may want to buy in your online store.

Unfortunately, WordPress’ built-in search feature is very basic.

By default, it doesn’t search all types of content, such as comments, reviews, or custom post types. This may stop visitors from finding what they’re looking for.

The built-in search also focuses on matching search words with the post or page content without paying attention to things such as tags, categories, or custom fields. These are important pieces of information that can help your visitors get more accurate search results.

Also, there’s no easy way to customize the built-in search. For example, if you wanted to prioritize a post’s titles over its excerpt or exclude certain pages from WordPress search, you would need to edit the code.

With that in mind, we’ll share how you can easily fix common problems with WordPress search not working. Here’s a quick overview of all the topics we’ll cover in this article:

Ready? Let’s get started.

How to Fix WordPress Search Box Not Appearing

WordPress has a built-in search feature, but unfortunately, not all themes include a search bar design. If your theme doesn’t include one, there are a few ways you can create one.

First, you can add a Search block to any widget-ready area of your WordPress website, such as the header or footer. This is a quick and easy way to show a search bar across every page of your WordPress site.

To add a Search block, simply go to Appearance » Widgets. You can then find the area where you want to add a search bar, and click on its arrow icon to expand.

Adding a search bar to a widget ready area

Then, just click on the ‘+’ icon.

In the popup that appears, type in ‘search’ and then select the Search block.

The WordPress search block

Once you’ve done that, you can customize the Search block using the row of icons that appears above the block. This includes changing the size of the search button and adding some text.

When you’re happy with how your Search block looks, go ahead and click on the ‘Update’ button. You can now visit your website to see the search bar live.

Another option is adding the Search block to a specific page or post. For example, you might just want to show a search bar on your homepage or landing page.

To do this, just open the post or page where you want to show your search bar. You can then click on the ‘+’ icon and add a Search block following the same process described above.

Adding a search bar to the WordPress homepage

Now, WordPress’s ready-made Search block is an easy way to add basic search to your site. However, if you want complete control over how your search bar looks and acts, then you’ll need a page builder plugin.

SeedProd is the best drag-and-drop page builder for WordPress and comes with over 80 professionally designed blocks, including a Search Form block. This allows you to instantly add a search bar to any area of your WordPress website.

All you need to do is open the SeedProd editor and then drag and drop the Search Form block onto your website’s layout.

The SeedProd Search Form block

Once you’ve done that, you can customize it using all the settings in the left-hand menu.

After adding the search bar, you can use the SeedProd theme builder to design a completely custom search results page that perfectly matches your brand.

For more information, you can see our guide on how to easily create a custom WordPress theme.

How to Fix WordPress Search Showing 404 Error

When a visitor performs a search, your site may show a 404 error such as ‘This page could not be found!’

A WordPress 404 error

You can often fix 404 errors by regenerating your permalinks. This rebuilds and repairs the WordPress permalink structure without changing anything on your site.

This may sound complex, but WordPress does all of the hard work for you.

To regenerate your permalinks, simply go to Settings » Permalinks.

WordPress' permalink settings

Then, you’ll want to scroll to the bottom of the page and click on the ‘Save Changes’ button.

And that’s it. WordPress will now regenerate your permalink structure. To make sure it worked, you can head over to your site and try performing a search.

For a more detailed look at rebuilding your permalink structure, see our complete guide on how to regenerate your permalinks in WordPress.

How to Fix WordPress Search Showing Irrelevant Results

Every time a visitor performs a search, you might want to show relevant search results. This helps visitors find interesting content, which will keep them on your site for longer and increase your sales and conversions.

However, the built-in WordPress search doesn’t always show the most accurate results. This is because it looks for the search term only in your post’s title and content.

With that in mind, we recommend installing an advanced search plugin.

SearchWP is the best custom search plugin for WordPress, used by over 50,000 websites. SearchWP can search every part of your site, including custom fields, WooCommerce products, categories and tags, PDF files, and more.

You can use SearchWP to adjust your website’s search algorithm and make sure your most important content appears at the top of the visitor’s search results.

The first thing you need to do is 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’ll want to 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

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

You can now either paste or type your license into the ‘License’ box. You’ll find this key in the email you got when you purchased SearchWP.

The SearchWP advanced search WordPress plugin

After entering the key, go ahead and click on the ‘Activate’ button.

SearchWP integrates with WordPress search automatically, so right away your site will start showing more accurate results. However, to get the best results, you’ll want to customize SearchWP’s search engine settings.

Here, it helps to think about the way search engines such as Google rank their content.

These search engines use algorithms to find high-quality content that closely matches the search term. It then ranks this content to make sure the best matches appear at the top of the search results page.

With SearchWP, you can build your own algorithms and set your own rules, just like Google. This can improve the visitor experience, boost your conversions, and help you make money online with WordPress.

To configure SearchWP’s settings, go ahead and click on the ‘Engines’ tab.

The SearchWP search engine settings

On this screen, you’ll see sections for the different types of WordPress content, such as pages and posts.

For each section, SearchWP shows the attributes it looks at when performing a search. In the following image, we can see that SearchWP searches the page’s title, content, slug, and the page’s excerpt.

The SearchWP search algorithm settings

There is also an ‘Applicable Attribute Relevance’ scale for each attribute. This is the weight that SearchWP gives to each attribute when ranking its search results.

In the following image, we can see that a post’s title has more weight than its URL slug.

The SearchWP WordPress settings

You can make an attribute more or less relevant using its slider.

There are no settings that are guaranteed to provide accurate results for every website. With that in mind, you may want to try different relevancy settings to see what gives you the most accurate search results.

You can also add different types of content to be included in your search results. For example, you can add PDF searching and indexing in WordPress if you have PDF files you want your visitors to be able to search for.

If you have any custom taxonomies or fields, then you can also tell SearchWP to look at this content when searching your site.

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

The SearchWP Add/Remove attributes button

This will open a popup. To get SearchWP to ignore an attribute, simply uncheck its box.

If you want to add an attribute, then click to check its box.

Removing attributes from WordPress search

Want to include a custom field or taxonomy in your searches?

Then, simply type in the name of that field or taxonomy and then select it when it appears.

Adding a custom field to WordPress search

Once you’re happy with your attributes, go ahead and click the ‘Done’ button.

You can now change the relevancy of your new attributes following the same process described above.

SearchWP's custom relevancy settings

To learn more about this, please see our step-by-step guide on how to improve WordPress search with SearchWP.

Once you’ve finished customizing SearchWP’s settings, make sure to click on the ‘Save Engines’ button to save your changes.

Saving your WordPress custom search settings

SearchWP will now use these new settings for all of its searches.

It’s worth visiting your site and performing a few searches just to check that you’re getting accurate results.

If you don’t see any improvement, then your WordPress theme may be performing its own search. This is known as a redundant search.

The easiest way to check whether this is happening with your theme is by opening its search.php file.

To access this file, you’ll need an FTP client. You can also use the file manager of your WordPress hosting cPanel.

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP.

Once you’re connected to your site, you can use FTP to open the wp-content/themes/ folder.

The FileZilla FTP client

Inside the ‘themes’ folder, find the theme you’re currently using on your WordPress website. You can then open this folder and find the search.php file.

Next, simply click on the search.php file and select ‘View/Edit.’

Editing the WordPress search.php file

This will open search.php in your computer’s default text editor.

Now, you’ll want to check this template for any queries that contain query_posts, new WP_Query, or get_posts. This usually means that your theme is performing a redundant search.

If search.php has any of these queries, then we recommend switching to an alternative WordPress theme. To help you out, we’ve created a list of the most popular and best WordPress themes.

Another option is to hire a WordPress developer who can write a new template that doesn’t perform a redundant search.

Note: Struggling with WordPress issues? Whether you’re facing technical issues, need customization, or want to improve your site’s performance, our team of experts is here to help. Get Premium WordPress Support today!

How to Fix WooCommerce Product Search Not Showing Accurate Results

If you have a WooCommerce store, then search results can help customers find products to buy. To sell more products, you’ll need to display accurate product search results.

However, by default, WordPress doesn’t look at your product reviews, attributes, or descriptions when performing its searches. Luckily, you can easily fix the problems with WooCommerce search with SearchWP.

You can set up SearchWP by following the same process described above.

Upon activation, let’s navigate to Settings » SearchWP. You can then click on the ‘Sources & Settings’ button.

SearchWP's source settings

In the popup that appears, make sure you check ‘Products.’

After that, just click on the ‘Done’ button to close the popup.

Creating a custom WooCommerce product search

You’ll now want to scroll to the new ‘Products’ section.

Here, you can customize the attributes that WordPress uses in its product searches by following the same process described above.

SearchWP's WooCommerce product search settings

For more information, please see our complete guide on how to make a smart WooCommerce product search.

Fast search helps visitors find what they’re looking for quickly. This helps improve the user experience and can increase your pageviews and conversion rates.

Unfortunately, the built-in WordPress search isn’t particularly fast. As you add more content, you may notice that your site takes longer and longer to return the search results.

The good news is that there are ways to speed up your site’s search. If you’re using an advanced search plugin like SearchWP, then you’re already off to a great start.

SearchWP is designed to deliver search results fast. It’s also fully customizable, so you can ignore some of your site’s content when performing a search. For example, you may tell SearchWP to ignore your media metadata. This can speed up your search by reducing the amount of content it has to look through.

You can also improve the search experience by adding live Ajax search to your WordPress site. This is a dropdown that guesses what visitors are searching for as they type, which can make your searches feel instant.

Live Search Preview

For more information, please see our guide on how to add live Ajax search to your site.

Expert tip: Anything you do to improve your website’s overall performance will also speed up your search. You can see our ultimate guide on how to speed up your WordPress site and boost performance.

We hope this article helped you learn how to fix problems with WordPress search not working. You may also want to see our guide on how to let users filter posts and pages in WordPress and how to exclude pages from WordPress search results.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

1 CommentLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.