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

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

When visitors use your WordPress website’s search bar, they expect to find helpful, relevant content. But if the results are empty, or worse, completely off target, they may get frustrated and leave your site to find answers elsewhere.

That’s why it’s important to fix it as soon as possible.

From our work with WordPress sites, we’ve found that most search problems come down to just five common issues. And the good news? They’re usually much easier to fix than you’d think! 🌟

In this guide, we’ll walk you through those five search problems and show you exactly how to solve each one. Whether your search isn’t working at all or just showing the wrong results, you’ll be able to get it back on track in no time.

How to fix WordPress search not working

Why Do WordPress Search Errors Happen?

If your site’s search isn’t working the way you expect, it’s usually because of how WordPress search works by default.

Most WordPress websites have a search bar to help visitors find useful content, whether it’s blog posts or products in your online store. But here’s the catch: the built-in WordPress search is very limited.

By default, it doesn’t search through everything. It skips things like blog comments, product reviews, and custom post types, so important content might not show up at all in the results.

WordPress search also mostly matches exact keywords in your post or page content.

The built-in search also focuses on matching search words with the post or page content. It ignores useful details like tags, categories, or custom fields, which could help visitors get better, more relevant results.

And if you want to tweak how search works, like prioritizing titles over excerpts or excluding certain pages, there’s no easy way to do that without touching 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.

For details, you can see our guide on how to add a search bar to the WordPress menu.

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.

We’ve used SeedProd to create landing pages and even entire websites, and we’ve had great results. To learn more about the plugin, check out our full SeedProd review.

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 also adjust your website’s search algorithm and make sure your most important content appears at the top of the visitor’s search results.

For a deeper look into the platform, read our detailed SearchWP review.

Is SearchWP the right search plugin for you?

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 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

On the popup that appears, you can simply uncheck the box to get SearchWP to ignore an attribute. If you want to add an attribute, then click to check its box.

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

Then, simply type in the name of that field or taxonomy and 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 control panel.

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 in the previous section.

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.

A fast and accurate search makes it easier for visitors to find what they need. It helps improve the user experience, which encourages visitors to explore more pages and take action.

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 a 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 for more information.

Bonus Tip: How to See Search Analytics in WordPress

Once your search is working properly, it’s a good idea to check if it’s actually helping your visitors find what they need.

That’s where search analytics comes in.

Search analytics let you see what people are typing into your search bar, what they’re clicking on, and whether they’re finding useful results. This information can give you a better understanding of what your visitors want and where your content might be missing the mark.

If you’ve been using SearchWP to fix your search issues, you’re in luck; it comes with search analytics built right in. On the reporting dashboard, you can easily see your most popular search terms, the total number of searches, which searches returned no results, and more!

Search analytics from SearchWP Metrics

By checking this data regularly, you can improve your content, fill in any gaps, and make sure your search results stay helpful and accurate.

For step-by-step instructions, you can check out our guide on how to see search analytics in WordPress.

FAQs: How to Fix WordPress Search Not Working

Search problems can be frustrating, especially when you’re not sure what’s causing them or how to fix them. Below, we’ve answered some of the most common questions to help you troubleshoot more effectively.

Why is my WordPress search function not working?

There are a few possible reasons your search function isn’t working as expected. It could be due to theme or plugin conflicts, broken permalinks, or even issues within your WordPress database. Identifying the cause is the first step toward a fix.

How can I make my WordPress search more accurate?

To improve search accuracy, try using a WordPress search plugin like SearchWP. These tools let you fine-tune what content gets indexed, such as custom fields, taxonomies, post types, and documents, so users get better, more relevant results.

What should I do if my search results page shows a 404 error?

If you’re seeing a 404 error on your search results page, it’s often a permalink issue. Go to Settings » Permalinks in your WordPress dashboard and click ‘Save Changes’ without making any edits. This refreshes your permalink structure and usually fixes the problem.

Can I exclude certain content from my WordPress search results?

Yes! You can exclude specific pages, posts, or even entire post types. Plugins like SearchWP make this easy, as you don’t have to do it manually with a code snippet added to your theme’s functions.php file.

How can I speed up my WordPress search?

For faster search performance, consider limiting searches to relevant content types and using a speed-optimized plugin like SearchWP.

Also, general site performance improvements, like caching and image optimization, can help speed things up across the board, including search.

We hope this article helped you learn how to fix problems with WordPress search not working. If you found this helpful, you may also want to see our guides on:

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.

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

Comments

  1. Congratulations, you have the opportunity to be the first commenter on this article.
    Have a question or suggestion? Please leave a comment to start the discussion.

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.