---
title: "How to Search Specific Custom Post Types in WordPress?"
url: https://nexterwp.com/docs/search-specific-custom-post-types-in-wordpress/
date: 2024-12-02
modified: 2026-09-27
lang: en
author: "Aditya Sharma"
description: "A documentation search that also returns blog posts, or a portfolio search that returns pages, makes the site feel unfinished. The Search Bar block can be locked to a single..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Search-Specific-Custom-Post-Types-in-WordPress_-1024x519.jpg
word_count: 496
---

# How to Search Specific Custom Post Types in WordPress?

## Key Takeaways

- Nexter Blocks Search Bar block searches posts from custom post types in WordPress when the Source section is set to Post and the Select Post dropdown is set to a type like Books.
- Advanced Custom Fields (ACF) creates a custom post type for this setup, and the post uses Books as the example custom post type.
- AJAX Search in the Extra Option tab enables searching custom post types from the dropdown or directly in the search result, with optional Label, Placeholder, and Show Count settings for the select dropdown.

A documentation search that also returns blog posts, or a portfolio search that returns pages, makes the site feel unfinished.

The Search Bar block can be locked to a single custom post type, so a bar placed in your docs section only ever searches docs.

*For every Search Bar setting in one place, see the [Search Bar guide](https://nexterwp.com/docs/add-a-search-bar-in-wordpress/).*

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

## Before You Start

- **Edition:** Free. Measured with Nexter Blocks Pro deactivated, the Search Bar renders identically — form, input, dropdowns, suggestions and results all work without Pro.- **Block to enable:** Search Bar, switched on under **Nexter > Blocks** in your WordPress dashboard.- **A registered, public custom post type with published items.** Post types registered as non-public are not searchable.

## Steps

- Select your **Search Bar** block and turn on the **specific post type** option.

![The specific post type option](https://nexterwp.com/wp-content/uploads/2026/09/sb-cpt-specific.webp)

- Choose the post type you want searched, then publish.

![Choosing the custom post type](https://nexterwp.com/wp-content/uploads/2026/09/sb-fe-cpt.webp)

## How It Behaves

- **The chosen type is written onto the block before the page loads.** Measured: with the option on, the block's default data carried the flag and the chosen type name, and a hidden post type input was added to the form.- **The hidden input is what makes the non-AJAX fallback work**, so a visitor without JavaScript still lands on a results page scoped to that type.- **It applies to every search from that bar.** There is no All option to escape it, which is the point.- **Only the title is searched by default.** Measured: with the default settings a term matched 4 posts by title; switching the search fields off entirely fell through to WordPress's own query and matched 15.- **It degrades to an ordinary search.** The block renders a real `<form method="get">` pointing at your site root, so with JavaScript disabled the bar still submits and lands on WordPress's own search results.

## Limitations

- **A post type dropdown overrides it.** Measured: when a filter field with a post type source is present, the hidden input is not added, and the dropdown decides the type instead. Use one or the other, not both.- **One type only.** To search across two custom post types, use a post type filter field listing both rather than this option.- **Non-public post types are not searchable**, regardless of this setting.- **Custom fields on those items are not searched.** Matching is on the standard fields; see the [custom field doc](https://nexterwp.com/docs/search-posts-by-custom-field-in-wordpress/) for that.

## Troubleshooting

### It is still returning posts and pages

There is probably also a post type filter field on the block. That takes precedence. Remove it, or set it to the single type you want.

### My post type is not in the list

It is likely registered as non-public, or registered with search excluded. That is set where the post type is registered, not here.

### Nothing is found even though items exist

Only the title is matched by default. If your items have short or generic titles, enable content matching as well.

## Related Docs

- [Add a search bar in WordPress](https://nexterwp.com/docs/add-a-search-bar-in-wordpress/)- [Search custom post types by custom taxonomy](https://nexterwp.com/docs/search-custom-post-types-by-custom-taxonomy-in-wordpress/)- [Add a search bar for posts](https://nexterwp.com/docs/add-search-bar-for-posts-in-wordpress/)- [Only search WooCommerce products](https://nexterwp.com/docs/only-search-woocommerce-products-in-wordpress/)- [Advanced tab settings](https://nexterwp.com/docs/use-advanced-tab-in-nexter-blocks/)

## Frequently Asked Questions

**Q: Why does my search bar still return blog posts and pages instead of one custom post type?**
A: That usually means a post type filter field is overriding the specific post type setting. In Nexter Blocks, the filter field takes precedence, so the hidden post type input is not added when that field is present. The fix is to use one method or the other, not both. If you want one locked search scope, keep the specific post type option and remove the conflicting filter field.

**Q: What do I need before I can search a specific custom post type in WordPress?**
A: The Search Bar block must be enabled under Nexter &gt; Blocks, and the target custom post type has to be public with published items. Nexter Blocks Pro is not required here because the Search Bar renders identically with Pro deactivated. That matters because non-public post types are not searchable at all, even if they exist in WordPress.

**Q: Can I search two custom post types with one search bar?**
A: The specific post type option only locks the bar to one type. If you need two custom post types in the same search, use a post type filter field that lists both instead of this setting. That keeps the search scope explicit and avoids the single-type lock that this option adds.

**Q: Why are my custom fields not being searched in this setup?**
A: This search mode matches standard fields, not custom fields. The page says custom fields on those items are not searched, so a result can exist without showing up if the match only lives in metadata. For metadata-based searching, Nexter WP points to the separate [custom field doc](https://nexterwp.com/docs/search-posts-by-custom-field-in-wordpress/).

**Q: Why do some items not show up even though they exist?**
A: By default, only the title is matched. The page measured 4 title matches with default settings, while turning search fields off entirely fell back to WordPress’s own query and matched 15. If your items have short or generic titles, enable content matching as well so the search has more text to work with.

**Q: Does this search still work if JavaScript is disabled?**
A: The Search Bar still submits as a real form and lands on WordPress’s own search results page. Nexter Blocks writes a hidden post type input into the form before load, and that hidden input is what keeps the non-AJAX fallback scoped to the chosen type. That means visitors without JavaScript still get a filtered results page instead of a broken search.
