Wednesday, May 18th, 2022

How to Make Custom Fields Searchable in WordPress

Do you want your visitors to easily find custom fields to find content on your website?

WordPress search doesn’t work with custom fields by default, which can make it harder for your visitors to find what they need. By making custom fields searchable, you can provide a better user experience for your visitors.

In this article, we will show you how to search custom fields in WordPress.

What are custom fields and why make them searchable?

WordPress custom fields allow you to store any type of additional information (metadata) about a post or page.

WordPress adds metadata such as title, author, date, time, and more to your posts and pages. With custom fields, you can add more information about your content, and display them on your website if you wish. A lot of popular WordPress plugins and themes use custom fields to store important data.

For example, content you enter into your WordPress SEO plugins like All in One SEO is technically a custom field, or custom product attributes that you can add to your WooCommerce products are sometimes custom fields. .


However, WordPress does not search for content on your website using custom fields. By default, when a visitor uses the search bar on your website, WordPress will only show them results where the title and content match their search terms.

Making your custom fields searchable improves the user experience on your WordPress website. This allows your visitors to easily find any content, keeps them on your website longer and minimizes any frustration.

That said, let’s take a look at how you can make custom fields searchable.

Make Custom Fields Searchable in WordPress

The easiest way to make custom fields searchable is to use the SearchWP plugin. This is the best WordPress search plugin and allows you to adjust the search algorithm without editing the code.

The plugin indexes everything on your WordPress site. For example, it uses custom fields, PDF documents, text, custom tables, files, categories, shortcodes, and more to improve WordPress search for your users.

In addition, SearchWP works seamlessly with other popular plugins such as Advanced Custom Fields, Meta Boxes, Toolset, Easy Digital Downloads, WooCommerce, and Pods.

search wp

To start indexing your custom fields, the first thing you need to do is install and activate the SearchWP plugin. If you need help, please refer to our guide on how to install a WordPress plugin.

When activated, you can go to Settings » SearchWP And then navigate to the ‘Engine’ tab from the WordPress admin panel.

After that, you need to click on the ‘Add/Remove Attributes’ button to add custom fields to the search algorithms for your posts, pages and media.

add and remove properties

When you click on the button, now a popup window will appear.

Go ahead and click on the dropdown menu under Custom Fields and then select the ‘Any Meta Key’ option to make all your custom fields searchable. Or you can type in the custom fields you want to include during the search process. If you don’t want to include them all.

Choose any meta key

After selecting the custom field, simply click on the ‘Done’ button.

A custom field option will now be added to the search algorithm for the post. You can see ‘custom field’ under applicable attribute relevance section.

Next, you can adjust the attribute slider to set the relevance weighting assigned to each attribute during the search.

adjust search relevance

For example, if you move the slider to the right and set it to maximum, SearchWP will give higher priority to data in custom fields when searching for content on your site.

Now you can repeat the steps to make the custom field searchable for pages and media files.

After making these changes, don’t forget to click the ‘Save Engine’ button.

Click on Save Engine Button

SearchWP will now index your content, PDF metadata, custom field metadata, images, files, and other types of metadata for inclusion in WordPress search.

You will be able to see the ‘Index Status’ in the right corner and see how many items the plugin has indexed.

SearchWP Index Status

Apart from this, SearchWP also provides other customization settings.

For example, if you go to the ‘Settings’ tab, you can add stopwords and synonyms to be ignored during the search process to improve relevance and performance.

The plugin will already have a list by default, but you can add more stopwords if you wish. Similarly, you can add synonyms for search terms that you want to ignore when searching.

Add Stopword to Settings

After this, you can go to the ‘Advanced’ tab and edit the settings.

For example, the plugin lets you enable the option to show partial matches when search terms show no results, limit results to exact matches when double quotes are used, remove the minimum word length, and many more.

SearchWP Advanced Settings

Now, if you want to view the search history and see which queries your users search the most, go to the ‘Statistics’ tab.

The plugin will give all statistics about your WordPress search from last 30 days or last 1 year. You can use this data to see what queries your users search for on your site and come up with new content ideas.

view search statistics

We hope this article helped you learn how to make custom fields searchable in WordPress. You can also check out our guides on how to register a domain name and the best WordPress plugins for business sites.

If you liked this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

How to Make Custom Fields Searchable in WordPress The post first appeared on WPBeginner.

Source link