[wp-trac] [WordPress Trac] #32824: Consistent search fields between posts and terms

WordPress Trac noreply at wordpress.org
Sun Dec 28 11:42:16 UTC 2025


#32824: Consistent search fields between posts and terms
-------------------------------------------------+-------------------------
 Reporter:  ashworthcreative                     |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:
  testing has-unit-tests                         |  administration
-------------------------------------------------+-------------------------
Changes (by shewa):

 * keywords:  needs-patch has-test-info good-first-bug => good-first-bug
     has-patch needs-testing has-unit-tests


Comment:

 This patch: https://core.trac.wordpress.org/attachment/ticket/32824/32824
 .post-slug-and-term-description-not-considered-for-search.patch addresses
 incomplete search behavior in both post and term queries.

 **Updated the following files:**

 1. src/wp-includes/class-wp-query.php:1455
 2. src/wp-includes/class-wp-term-query.php:1110


 For posts, admin search results were not matching against the post slug
 (post_name). The patch includes post_name in the default search columns
 used by WP_Query.

 For terms, searches did not match keywords present only in the term
 description. The patch updates the term search SQL to include the term
 taxonomy description.

 New PHPUnit tests are included to cover both cases and ensure correct
 behavior when the search term exists only in the slug or description.

 Tests pass locally.

 **The following test files are updated:**

 1. tests/phpunit/tests/query/search.php
     method added: test_search_matches_post_slug
 2. tests/phpunit/tests/term/query.php
     method added: test_search_matches_term_description

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/32824#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list