WordPress can show posts by a selected author with a native query, but its standard keyword search does not automatically match author names. Choose the right method for the task: use an author-filtered listing when visitors need to browse one writer’s posts, or add author data to the search index when an author’s name should work as a search term.
Choose between an author-filtered listing and keyword search
These are separate features. An author-filtered listing narrows posts to a selected writer; a visitor might reach it from an author page, filter, or link. Standard WordPress keyword search, by contrast, searches post title, excerpt, and content according to FacetWP’s search documentation. To make a writer’s name return matching posts in general search, the search system must also index author details or be customized to match them.
As an Amazon Associate I earn from qualifying purchases.
- Use a listing filter when the user selects or visits a particular author.
- Use author-aware keyword search when typing an author name into the site’s search box should return that writer’s posts.
Filter a WordPress listing by author
For a developer-managed listing, WordPress’s WP_Query API provides author query arguments. Use the author’s WordPress user ID for a single-author query:
Recommended Free Tools
$query = new WP_Query( array( 'author' => 123 ) );
Replace 123 with the intended user ID. To query by a user’s nicename instead, use author_name:
#1 Best Overall
$query = new WP_Query( array( 'author_name' => 'rami' ) );
The value for author_name must be the user’s user_nicename, not the display name shown on the site. For multiple WordPress user accounts, the API also supports author__in with an array of user IDs. These arguments filter a query; they do not make author names searchable through the ordinary keyword search box.
Make author names match keyword searches
To return a post when someone searches for its author’s name, the search implementation needs to include author information. One route is custom development: WordPress search behavior can be adjusted through hooks such as posts_search. If the site uses FacetWP’s Search facet with its WP Default engine, its documentation describes the facetwp_search_query_args hook for modifying query arguments. These hooks are starting points for site-specific work, not turnkey author indexing; test the implementation against the site’s search setup and any other search customizations.
Rank #2
Another route is a search product with author indexing. SearchWP describes an integration that can index author details including display name, first name, last name, and bio so they can be used in article search. This is a vendor-described paid-product capability, not an independent performance assessment. Check SearchWP’s current integration and plan details before choosing it: the cited feature page does not establish current pricing or which plan includes the integration. See SearchWP’s author search information.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Account for co-authors and guest authors
A user-ID filter may not cover every author model. FacetWP’s Co-Authors Plus guidance explains that the plugin represents authors as terms in a custom author taxonomy. A taxonomy query can therefore cover regular users, co-authors, and guest authors; a query based only on a WordPress user ID does not work for guest authors.
Rank #3
There is also an AJAX-specific consideration. FacetWP notes that the native author_name query variable may not be available while an AJAX listing is being filtered. Its examples retrieve author context from the request URI instead. If an author filter works on initial page load but fails after AJAX updates, check how the author context is passed into the request and whether the listing is querying the Co-Authors Plus taxonomy.
Quick Recap
Best Value
Rank #4
Pick the implementation that fits the site
| Reader need | Author setup | Suitable approach | Key consideration |
|---|---|---|---|
| Show posts by a selected writer | One WordPress user | WP_Query with author (user ID) or author_name (user nicename) |
Creates a filtered listing; it does not change keyword search. |
| Show posts from several WordPress users | Multiple user accounts | WP_Query with author__in (array of IDs) |
Works with user IDs, not guest-author records. |
| Search general site content by author name | Author details must be indexed | Custom search hooks or a search product that indexes author fields | Custom code is site-specific; verify a product’s current features and plan requirements. |
| Filter co-authored or guest-authored posts | Co-Authors Plus records | Query its custom author taxonomy |
For FacetWP AJAX filtering, author context may need to come from the request URI. |
Test the result before publishing the search experience
- For a listing filter, confirm that the intended author’s posts appear and that another author’s posts do not.
- For keyword search, try an author’s display name and, if intended, first and last name separately. Confirm that matching posts appear alongside ordinary content matches.
- For co-authors or guest authors, test posts attributed to each author type rather than assuming user-ID queries include them.
- For AJAX facets, test both the initial page and a refreshed result set so a missing author context does not silently broaden or empty the listing.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




