How to include Custom Post Type in WordPress Search Result?

In the WordPress default search, custom post types are not included in search results. So in order to include custom post types in the search result, we have two methods: one using custom code in your theme functions.php file and second using third party free WordPress plugin.

Custom Method

You can include custom post types in the search result by adding below function in your functions.php file.

Using WP Extended Search WordPress Plugin

To include Custom Post Types in WordPress Search, you can also use third party free WordPress Plugin WP Extended Search. WP Extended Search provided the feature to include/exclude Tags, Categories, Custom Post Types, Taxonomies, and Custom Meta Keys in default WordPress Search.

You can read in brief about the usage and features of WP Extended Plugin in my post: How to Improve WordPress Search with WP Extended Search.

Share

Disclaimer: *This post may contain affiliate links. I may earn a small commission when you click on the links and buy the products with no additional cost to you. Thank you.

Jetpack

2 responses

  1. Running this in the WP admin posts search I get
    Notice: Array to string conversion in D:\wwwroot\enhabit\wp-admin\edit.php on line 327

    1. Hi Adam,

      The notice message you showed doesn’t seem related to the code in the post. Can you be more specific about the issue that you are having, so that I can help you with the issue?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.