Remember that detailed post you wrote three years ago? Somebody visiting your site today is looking for exactly that information. The question is whether your search box will show it to them.
Search is one of the most direct signals you get from a visitor. They’re telling you, in their own words, what they came for. If the results miss, they leave, and the old content you worked hard on might as well not exist.
WordPress’s built-in search ranks results by relevance, not date. It’s also limited in ways that aren’t obvious until a visitor can’t find something you know is there.
How WordPress Ranks Search Results
A common belief is that WordPress lists search results newest first. That used to be true, but since WordPress 3.7, results have been ordered by relevance using a simple set of rules.
For a search with more than one word, WordPress ranks posts in this order:
- The full phrase appears in the title
- All of the search words appear in the title
- Any of the search words appears in the title
- The full phrase appears in the excerpt
- The full phrase appears in the content
- Everything else that matches
For a single-word search, posts with the word in their title come first.

That short list is the whole ranking system. WordPress doesn’t count how often a word appears, doesn’t weigh one field against another beyond these rules, and doesn’t understand related words. A search for “running” won’t find a post that only says “run”, and a typo returns nothing at all.
What WordPress Search Looks At
By default, WordPress searches three fields:
- The post title
- The excerpt
- The post content
It searches posts, pages, and any custom post types registered as searchable. Media attachments are left out.
That means a lot of your content is invisible to search:
- Custom fields, including anything stored by ACF or a page builder outside the main content
- Categories and tags
- Comments
- Author names
- PDFs and other documents you’ve uploaded
- WooCommerce product data such as SKUs and attributes
If your site relies on any of these, built-in search will miss results your visitors expect to see.
Search Tricks Your Visitors Can Use
WordPress supports two bits of search syntax:
- Quotes search for an exact phrase:
"block themes" - A hyphen excludes a word:
hosting -shared
They’re handy for power users, but most visitors will never try them.
Fixing Common Search Problems With a Little Code
If you’re comfortable adding a snippet to a child theme or a code snippets plugin, you can fix a couple of common annoyances without installing a search plugin.
Show only blog posts in search results, leaving out pages:
add_action( 'pre_get_posts', function ( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( 'post_type', array( 'post' ) );
}
} );
Search titles only, using the search_columns option added in WordPress 6.2:
add_action( 'pre_get_posts', function ( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( 'search_columns', array( 'post_title' ) );
}
} );
search_columns only accepts the title, excerpt, and content. To search custom fields or categories, you’ll need a plugin.
Adding Search to Your Site
On a block theme, add the Search block wherever you want a search box, such as your header or a sidebar. You can choose whether the button sits inside or outside the field, show it as an icon, or hide the label. On a classic theme, use the Search widget or your theme’s built-in search form.
Either way, the form sends visitors to your theme’s search results template, so check that the page shows clear titles, excerpts, and a second search box.
When You Need a Search Plugin
A search plugin makes sense when:
- Your content lives in custom fields, custom post types, or documents
- You want typo tolerance, related word matching, or weighting you control
- You want results to appear as visitors type
- You want to see what people search for and which searches come up empty
- You run a WooCommerce store
The two most popular options build their own search index inside your database. SearchWP is premium and gives you the most control, including PDF search. Relevanssi has a capable free version. Hosted services like Jetpack Search, ElasticPress.io, and Algolia move the work off your server entirely.
We compare all of them in our roundup of the best WordPress search plugins. If you run a store, see the best WooCommerce product search plugins instead.
What About Google Search on Your Site?
Many site owners used to swap WordPress search for Google’s. Here’s where those options stand today:
- The Google Custom Search WordPress plugin is no longer available on WordPress.org.
- Google’s Custom Search JSON API is closed to new customers, and existing customers have until January 1, 2027 to move to an alternative.
- Google’s Programmable Search Engine, the embeddable search box you configure on Google’s site, is still offered.
Google-powered search can only show what Google has indexed, so new posts won’t appear until Google crawls them. For most WordPress sites, a search plugin is the more reliable choice today.
Make Your Old Posts Findable Again
Test your search with a few queries you know the answers to. If the right posts don’t show up near the top, add one of the snippets above or install a plugin.
How do you handle search on your WordPress site? Let us know in the comments below.