We’ve found a small bug in WordPress that makes the search box disappear when deleting a tag or category. It’s nothing catastrophic, just one of those little annoyances that shouldn’t happen.
While working on a WordPress website, I searched for a tag, found the one I wanted and deleted it. Nothing particularly unusual about that.
Except the search box disappeared too!
It turns out that when your search returns just one result, deleting that result makes WordPress think there’s nothing left to search. So it helpfully removes the search box, even though there may be hundreds of other tags or categories.
Not terribly helpful if you want to search for something else.
We traced the problem to a recent change in WordPress itself and confirmed that the offending code is still present in version 7.2 Beta 5.
I’ve reported the bug to WordPress Core as ticket #66672. With any luck, it’ll be fixed in time for WordPress 7.2.
It’s a tiny thing, but that’s the beauty of open-source software. Spot something that isn’t quite right, report it, and hopefully make WordPress a little better for everyone.
Update: Well, that was quick!
Just two minutes after reporting the bug, Sainath Poojary had already submitted a proposed fix on GitHub.
It’s not been merged yet, but with WordPress 7.2 just around the corner, there’s a chance this little annoyance could be fixed in the next release.
Two minutes. That’s open-source software at its best! 🥳

Leave a Reply