---
title: "How to Search Custom Post Types by Custom Taxonomy in WordPress?"
url: https://nexterwp.com/docs/search-custom-post-types-by-custom-taxonomy-in-wordpress/
date: 2024-12-02
modified: 2026-04-14
author: "Aditya Sharma"
description: "Are you looking to search for custom post types by custom taxonomy in WordPress? Custom post types and taxonomies, allow users to organize and display their content in a structured..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Search-Custom-Post-Types-by-Custom-Taxonomy-in-WordPress_-1024x519.jpg
word_count: 317
---

# How to Search Custom Post Types by Custom Taxonomy in WordPress?

## Key Takeaways

- Nexter Blocks includes a Search Bar block that allows users to search custom post types based on custom taxonomies in WordPress.
- Users can create a custom post type and its custom taxonomy using the free Advanced Custom Fields (ACF), such as Books and Book Authors.
- The Search Bar block can display the number of posts in a taxonomy by enabling the Show Count toggle.

Are you looking to search for custom post types by custom taxonomy in WordPress? Custom post types and taxonomies, allow users to organize and display their content in a structured manner.

With the Search Bar block from the Nexter Blocks, you can easily allow users to search from custom post types based on custom taxonomies in WordPress.

*To check the complete feature overview documentation of the Nexter Blocks Search Bar* block, [click here](https://nexterwp.com/docs/add-a-search-bar-in-wordpress/).

***Requirement  - This block is a part of the Nexter Blocks, make sure it's installed & activated to enjoy all its powers.***

[LIVE BLOCK LINK](https://nexterwp.com/nexter-blocks/builder/wordpress-ajax-search-bar/)

To do this, make sure you have created at least one custom post type and its custom taxonomy, you can use the free[ Advanced Custom Fields (ACF)](https://wordpress.org/plugins/advanced-custom-fields/) to[ create a custom post type](https://www.advancedcustomfields.com/resources/registering-a-custom-post-type/) and [custom taxonomy](https://www.advancedcustomfields.com/resources/registering-a-custom-taxonomy/).

For instance, we have created a custom post type called Books and Book Authors as its custom taxonomy.

Then add the Search Bar block on the page or template and follow the steps -

1. Open the item under **Search Bar** and select **Taxonomy** from the **Source** section.

2. From the **Select Taxonomy **dropdown, select your custom taxonomy, i.e. Book Authors here. 

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-custom-taxonomy-types.png)

Now, you should be able to see a dropdown beside the search bar.

In the **Label** field, you can add a label name for the select dropdown.

In the **Placeholder** field, you can add a placeholder text for the select dropdown. 

You can show all the search results on load by enabling the **All Result **toggle. 

From the **Show Count** toggle, you can show the number of posts the item has in numbers.

3. Now go to **Extra Option** tab and enable the **AJAX Search** toggle.

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-ajax-search-4.png)

Now you can select a custom taxonomy from the dropdown to show all the posts within the custom taxonomy in the search result or you can directly search for posts within a specific custom taxonomy. 

## Frequently Asked Questions

**Q: What should I do if the Search Bar block isn't showing my custom post types?**
A: If the Search Bar block is not displaying your custom post types, ensure that you have created at least one custom post type and its associated custom taxonomy. For instance, if you created a custom post type called Books, make sure the taxonomy, like Book Authors, is also set up. This is crucial for the Search Bar to function correctly.

**Q: Is the Search Bar block compatible with other page builders besides Gutenberg?**
A: The Search Bar block is designed primarily for Gutenberg as part of the Nexter Blocks. While it supports Elementor and Bricks, the full functionality and integration are optimized for Gutenberg. If you're using another page builder, you may not achieve the same level of performance or ease of use.
