By default, WordPress search doesn’t include comments, which can make it challenging for visitors to find interesting conversations and engage with other users. But we figured out a way to change that, making your site’s discussions more discoverable and engaging.
Some readers have asked us about how to make this possible so that they can highlight valuable user feedback, showcase product reviews in their online stores, or simply create a more interactive community on their blogs.
In this article, we will show you how you can make blog comments searchable on your WordPress website.
Why Make Blog Post Comments Searchable in WordPress?
A lively and interesting comment section can keep people on your WordPress website longer and create a sense of community. With that in mind, you’ll want to do everything you can to get more comments on your WordPress blog posts.
WordPress doesn’t include comments in its search results by default, so visitors may struggle to find interesting discussions and connect with other users.
If you run an online store, then visitors may even use the comments to leave feedback and reviews. By making these comments searchable, you may be able to get more sales.
That being said, let’s see how you can make blog post comments searchable in WordPress. You can use the quick links below to navigate through the tutorial:
Step 1: Install and Set Up SearchWP
The easiest way to make blog post comments searchable in WordPress 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 WordPress doesn’t search by default.
For more information, check out our complete SearchWP review.
To make your blog post comments searchable, you’ll need to install and activate SearchWP. If you need more details, please see our guide on how to install a WordPress plugin.
SearchWP will now take you to the SearchWP » Settings page automatically.
On this screen, activate your SearchWP license key. You’ll find this information in the email you got when you purchased SearchWP and in your account on the SearchWP site.
Step 2: Configure Your Search Engine to Make Comments Searchable
You are now ready to improve the WordPress search with SearchWP, so go ahead and click on the ‘Algorithm’ tab.
Here, you can customize the content that SearchWP includes in its results. By default, posts are searchable and are broken into title, content, slug, and excerpt.
To search the comments on your WordPress blog, click on the ‘Sources & Settings’ button.
A popup will now show all the different types of content that SearchWP can search. You may see different options depending on the plugins you have installed.
For example, SearchWP can search WooCommerce products to create a smart WooCommerce product search. By default, the plugin searches your site’s posts, pages, and media.
Go ahead and check the ‘Comments’ box, then click ‘Done.’
SearchWP will now include all comments in its search results. You can fine-tune how SearchWP searches your blog comments by scrolling to the bottom of the screen.
In the new ‘Comments’ section, click on the ‘Add/Remove Attributes’ button.
On this screen, you’ll see sections for the different content, such as the author’s name, email address, and comment text. You can now check and uncheck these boxes, depending on the content you want SearchWP to search.
In the following image, we are telling SearchWP to look at the comment’s content by checking the ‘Comment’ box, as well as the name and email address of the person who posted it.
After making your selection, click on the ‘Done’ button. The options you selected will now appear in the ‘Comments’ section.
For each option, SearchWP has an ‘Applicable Attribute Relevance’ scale. This is the weight that SearchWP will give to each attribute when searching the comments on your blog.
Content that matches an attribute with high relevancy will appear higher in the search results. By contrast, content that matches an attribute that has less relevancy will appear lower in the user’s search results.
By default, all the attribute sliders are set to ‘low,’ but you can change that by dragging the slider to the right.
Every site is unique, so you may want to try different relevancy settings to see what gives you the most accurate and helpful search results.
If you want to remove an attribute from your search at any point, then simply repeat the steps above, but this time uncheck the box.
When you are happy with how the search is configured, scroll up and click on the ‘Save’ button.
Now, scroll down and click on the ‘Rebuild Index’ button.
This will add all your site’s comments to the search index so that they appear in relevant results.
Step 3: Create and Embed Your Search Form in WordPress
With the previous step done, comments will start appearing in your site’s search results. But to make sure users can access your search form, you need to create one first.
For more information, you can check out our step-by-step guide on how to create a custom WordPress search form.
Once your search form is ready, you can embed it anywhere on your WordPress website. For example, you can add a search bar to your WordPress menu, where users can easily see it no matter what page they’re on.
You can also add your search form to WordPress posts or pages to let readers do a quick search while engaging with your content.
It’s also possible to use multiple search forms in WordPress. This will be helpful if you want to create a search form for a specific custom post type, like WooCommerce products, and another for generic content like posts and comments.
Discover More Ways to Improve Your WordPress Search
Now that you know how to make your blog post comments searchable in WordPress, you can check out other articles to enhance your website’s search experience:
- How to Customize the Search Results Page in WordPress
- How to Add Fuzzy Search in WordPress to Improve Results
- How to Add Multilingual Search in WordPress
- How to Exclude Specific Pages, Authors, and More from WordPress Search
- How to Add PDF Indexing and Searching in WordPress
- How to Change the Default Search URL Slug in WordPress
- How to Add Live Ajax Search to Your WordPress Site (The Easy Way)
We hope this article helped you learn how to make blog comments searchable in WordPress. You may also want to see our picks of the best WordPress comment plugins and our guide on how to notify users when their comment is approved in WordPress.
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.
Elena Liva
Absolutely loved this blog post! The flow of information is smooth, and the accompanying images are breathtaking. A must-read for aspiring bloggers!
WPBeginner Support
Glad you found our post helpful!
Admin
Olaf
It’s a bit disappointing that WordPress doesn’t natively include comments in search results. On blogs, comments often contain valuable information. As a developer, I frequently search for solutions in many articles on Google, and I know the real gems are often in the discussions under the articles. This is a great way to make the most of your blog, as users searching for advice might find their solution hidden in one of the many comments on the site. This could be a reason why they return. It’s a real functional advantage for a website.
Jiří Vaněk
It never occurred to me that comments aren’t searchable using the standard WordPress search. Yet, comments are often an excellent additional source of information on a technical website. Thanks for the inspiration on what could be improved in website search, as comments often provide valuable additional information.
WPBeginner Support
Glad we could share how to add comments to your search
Admin
Pak Shaheens
Best guidelines explained:) Great
WPBeginner Support
Glad you like our guides
Admin