[wp-trac] [WordPress Trac] #65298: Searched text is not cleared from the Library search bar after refresh

WordPress Trac noreply at wordpress.org
Thu Jun 4 09:30:23 UTC 2026


#65298: Searched text is not cleared from the Library search bar after refresh
-------------------------------------------------+-------------------------
 Reporter:  abduremon                            |       Owner:
                                                 |  westonruter
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  7.1
Component:  Administration                       |     Version:  4.9
 Severity:  major                                |  Resolution:
 Keywords:  has-screenshots has-patch needs-     |     Focuses:
  testing                                        |  administration
-------------------------------------------------+-------------------------

Comment (by nadabulija):

 == Bug Report
 === Description
 The searched text is not cleared from the Library search bar after refresh

 === Environment
 - WordPress: 7.0
 - Subdirectory: No
 - PHP: 8.3.31
 - Server: PHP.wasm
 - Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
 - Browser: Chrome 148.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.5
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.3.0

 === Steps to Reproduce
 - Navigated to Media → Library from the WordPress admin menu and ensured
 the Media Library was displayed in Grid View.
 - Entered a keyword (for example, "test") into the search field located in
 the upper-right corner and pressed Enter.
 - Verified that the URL was updated with the search query parameter, such
 as upload.php?search=test.
 - Cleared the search field manually by removing all entered text.
 - Pressed Enter (or allowed the search to refresh) and confirmed that the
 URL reverted to upload.php, with the ?search= parameter removed.
 - Reloaded the page and verified that the search box stayed blank and that
 no previous search term was restored.

 === Expected Results
 When the search term is removed from the Media Library search field and
 the search is refreshed, the URL should return to upload.php without the
 ?search= parameter. After reloading the page, the search field should
 remain empty and no previous search term should be restored.

 === Actual Results

 After clearing the search field and refreshing the search, the URL
 returned to upload.php as expected. However, after reloading the page, the
 previously entered search term reappeared in the search field, even though
 no search parameter was present in the URL.

 https://www.loom.com/share/3c570f5590cc4d9280639966b3640db9

 === Additional Notes
 Tested in the playground, patch is not working as expected

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


More information about the wp-trac mailing list