---
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-08-18
author: "Aditya Sharma"
description: "Are you looking to search for custom post types by custom taxonomy in WordPress? Custom post types and taxonomies let you organize content in structured categories, making it easier for..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Search-Custom-Post-Types-by-Custom-Taxonomy-in-WordPress_-1024x519.jpg
word_count: 476
---

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

## Key Takeaways

- Nexter Blocks Search Bar block sets a custom taxonomy as the search source, so visitors filter custom post type content by taxonomy terms directly from the search bar.
- Advanced Custom Fields (ACF) creates a custom post type and custom taxonomy, and the example uses Books with Book Authors.
- AJAX Search updates results in real time without a full page reload, while All Result shows all matching posts on page load and Show Count displays the number of posts for each taxonomy term.

Are you looking to search for custom post types by custom taxonomy in WordPress? Custom post types and taxonomies let you organize content in structured categories, making it easier for visitors to find exactly what they need.

The Search Bar block in Nexter Blocks lets you set a custom taxonomy as the search source, so visitors can filter custom post type content by taxonomy terms directly from the search bar.

*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/).*

**Best Used For:**

- Niche content sites with multiple custom post types (Books, Recipes, Courses) that need taxonomy-filtered searching- Directory or listing sites where visitors narrow results by taxonomy term before running a search- Membership sites that organize content by custom author, category, or tag taxonomies

**Requirement** – This block is a part of Nexter Blocks. Make sure it is installed and activated.

[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/) plugin 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 example, the steps below use a custom post type called Books and a custom taxonomy called Book Authors.

Add the Search Bar block to the page or template and follow the steps –

1. Open the item under **Search Bar** and select **Taxonomy** from the **Source** section. This tells the search bar to display taxonomy terms for filtering rather than searching post titles directly.

2. From the **Select Taxonomy** dropdown, select your custom taxonomy, such as Book Authors in this example. The search bar will use terms from this taxonomy to filter results.

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

A dropdown now appears beside the search bar showing the available taxonomy terms.

In the **Label** field, enter a display name for the taxonomy dropdown. This helps visitors understand what they are selecting, such as “Author” or “Category.”

In the **Placeholder** field, enter placeholder text for the taxonomy dropdown, such as “Select an author” or “Choose a category.”

Enable the **All Result** toggle to display all matching posts on page load before the visitor performs a search. Use this when you want visitors to see the full content list by default without typing anything.

Enable the **Show Count** toggle to display the number of posts for each taxonomy term in the dropdown. Use this when you want to show visitors how many results are available per category before they select one.

3. Go to the **Extra Option** tab and enable the **AJAX Search** toggle. This allows search results to update in real time without a full page reload, giving visitors a faster and smoother experience.

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

Visitors can now select a taxonomy term from the dropdown to display all posts within that term, or type in the search field to find posts within a specific custom taxonomy.

## Frequently Asked Questions

**Q: Why isn’t my custom taxonomy showing in the WordPress search bar?**
A: The Search Bar block only filters by taxonomy terms after the Source is set to Taxonomy and a specific taxonomy is selected in the Select Taxonomy dropdown. If that taxonomy is missing, the usual cause is that the custom post type or custom taxonomy has not been created yet. The page also notes that Nexter Blocks must be installed and activated before this works.

**Q: What do I need before I can search custom post types by taxonomy in WordPress?**
A: You need at least one custom post type and its custom taxonomy already created. The tutorial uses Books as the custom post type and Book Authors as the custom taxonomy, and it mentions Advanced Custom Fields (ACF) as a free way to create both. That setup matters because the search bar can only filter terms that already exist.

**Q: Can I use this for a directory or membership site with multiple content types?**
A: Nexter Blocks is built for exactly that kind of setup. The page calls out niche content sites with multiple custom post types like Books, Recipes, or Courses, plus directory, listing, and membership sites that organize content by custom author, category, or tag taxonomies. In those cases, taxonomy filtering helps visitors narrow results before they search.

**Q: Should I turn on AJAX Search for a taxonomy-filtered search bar?**
A: AJAX Search is the better choice when you want results to update in real time without a full page reload. That makes the experience feel faster and smoother, especially on content-heavy pages where visitors are switching between taxonomy terms. If you want a more static page load behavior, leave it off.

**Q: What does the All Result toggle do in a WordPress taxonomy search bar?**
A: All Result shows all matching posts on page load before anyone types or selects a term. That is useful when you want the full content list visible by default instead of starting from an empty state. It pairs well with directory-style pages where visitors may want to browse first and filter second.

**Q: How do I show how many posts are in each taxonomy term?**
A: The Show Count toggle adds a result count next to each taxonomy term in the dropdown. That gives visitors a quick sense of which categories are worth clicking before they filter. It is especially useful on larger archives because it reduces guesswork and helps people avoid empty or low-result choices.
