Do you want to make custom post types searchable in WordPress?
WordPress does not display custom post types in its search results by default. As a result, your readers may miss out on some excellent information, and you may lose out on additional page views.
We’ll teach you how to integrate custom post types in WordPress search in this article.
How to Search for Custom Post Types in WordPress
Although WordPress has a search function, it is fairly restricted. If you use WordPress to create custom post kinds, these things will not appear in search results.
The SearchWP plugin is the simplest method to add custom post kinds in WordPress search.
You’ll need to install and activate SearchWP to incorporate custom post types in WordPress search. Please visit our article on how to install a WordPress plugin if you need assistance.
After activation, go to your website’s toolbar and click the new ‘SearchWP’ button. After that, you may click ‘Activate License.’
Over 30,000 websites use SearchWP, the greatest custom search plugin for WordPress. It’s simple to use and allows you to search for information not found in the usual WordPress search.
Click the ‘License’ tab after you’ve done that.
Your licence key may now be pasted into the ‘License’ box. This key may be found in the email you received when you purchased SearchWP, as well as in your SearchWP account.
After you’ve copied and entered this information into the ‘License’ area, click the ‘Activate’ button next to it.
Custom post types may now be included in WordPress search results thanks to SearchWP.
Simply select the ‘Engines’ option to begin.
On this screen, you’ll find categories for the various sorts of material that SearchWP includes in its search results from your WordPress site.
This plugin searches your website’s media, articles, and pages by default.
Click the ‘Sources & Settings’ button to add custom post types in your searches.
All of your post types, as well as comments, media, and more, are shown under ‘Sources.’ Simply select the boxes next to all of the custom post types you wish to see in your search results.
Click the ‘Done’ button after that.
On your WordPress blog, each of your custom post types will now have its own area.
SearchWP displays all of the criteria that it will consider when searching your custom post types in each area.
SearchWP provides a ‘Applicable Attribute Relevance’ scale for each attribute. When SearchWP searches your custom post types, this is the weight it gives to this property.
The Title, Slug, and Excerpt sliders are all the way to the right by default, giving them the most weight. Because the Content slider is in the middle, it has less weight.
Do you want to adjust the weight of an attribute? Simply move the slider.
You might wish to experiment with different relevance settings to determine which ones provide the most accurate and useful search results.
Attributes can also be removed. For example, your custom post type can include properties that you don’t want SearchWP to see, such as ones you made for your own use exclusively.
Click the ‘Add/Delete Attributes’ button to add or remove attributes.
To add an attribute, simply tick the box next to it.
If you want SearchWP to disregard a certain attribute, uncheck its box.
If you’ve developed any custom taxonomies or fields, SearchWP may wish to take a look at them while searching your custom post types.
Simply click on the ‘Custom Fields’ or ‘Taxonomies’ fields to do so. Then fill in the name of the characteristic you’d want to add and click it when it appears.
Click the ‘Done’ button when you’re satisfied with your selections.
You can adjust the weight of this item if you’ve added any characteristics, custom fields, or taxonomies. Moving the slider to the right, as previously said, will give this attribute more weight, implying that it will have a greater influence on the search results.
Scroll to the top of the screen once you’ve done adjusting SearchWP’s options.
Then, to preserve your modifications, click the ‘Save Engines’ option.
The notice ‘The index needs to be rebuilt’ may appear at this stage in SearchWP.
If you see this message, click the ‘Rebuild Index’ button to rebuild the index. This will add your custom post types to the search index of your site, allowing them to appear in search results.
That is all there is to it. Your custom post types will now appear in WordPress’s search results.
After that, you might wish to activate some advanced options to make it simpler for visitors to locate what they’re searching for.
Click on the ‘Advanced’ tab to look at these options.
This page displays some of the more complex options available to you.
Check the ‘Partial matches (fuzzy when required)’ option, for example, if you wish to provide results that don’t exactly match the phrase that the visitor searched for.
our tutorial on how to make money blogging with WordPress and our list of must-have Please review our step-by-step tutorial on how to optimise WordPress search with SearchWP for more information on SearchWP’s advanced options.
After you’ve added custom post types to WordPress search, you might want to construct a search form that only shows search results from your custom post type category, so visitors can discover what they’re searching for faster. See our step-by-step guide on how to construct an advanced search form in WordPress for custom post types for more information.
We hope you found this article useful in learning how to search for custom post types in WordPress. You may also check out WordPress plugins for business sites.