• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Equalize Digital Home

Equalize Digital

Website Accessibility Consulting, Training, and Development

  • My Account
  • Support
  • Checkout
  • Software
    • Accessibility Checker
      • Features: Accessibility Checker
      • Documentation: Accessibility Checker
      • Buy Accessibility Checker
      • Start Free
    • ArchiveWP
      • Documentation: ArchiveWP
      • Buy ArchiveWP
      • Demo All Plugins
  • Services
    • Accessibility Audits
    • User Testing
    • Accessibility Remediation
    • VPAT & ACR Preparation
    • Accessibility Monitoring
    • Web Accessibility Training
    • Accessibility for Agencies
  • Company
    • About Us
    • Our Team
    • Industry Expertise
    • Accessibility Statement
    • Contact Sales
    • Become An Affiliate
  • Learn
    • Online Courses
    • Accessibility Meetup
    • Articles & Resources
    • Accessibility Craft Podcast
    • Upcoming Events
    • Office Hours
    • Custom Accessibility Training
    • Global Accessibility Awareness Day
  • Contact Sales
  • My Account
  • Support
  • Checkout
Home / Accessibility Checker / Force Error on Empty Search

Force Error on Empty Search

By default, when a search is submitted with an empty search field, WordPress returns the main index, showing posts and pages seemingly at random with no error notice.

This can cause confusion and make it more difficult for users to try their search again if the search field is no longer visible. It may also be considered a failure of Web Content Accessibility Guidelines (WCAG) success criterion 3.3.1 Error Identification (Level A).

Here are easy, step-by-step instructions for ensuring blank searches in WordPress show an error.

How to Force Error Messages for Empty Search Form Submissions in WordPress

If your website is not providing sufficient error messages on blank searches, you can easily resolve that issue by using the WordPress Accessibility Checker plugin.

Step 1

Click into the Accessibility Checker plugin settings in your WordPress dashboard (you must be logged in with an administrator account to access these settings).

Arrow pointing to the Settings page in the WordPress admin menu, which can be found under the Accessibility Checker top-level page.

Step 2

Go to the “Fixes” tab in the Settings Tabs navigation.

Arrow pointing to the Fixes page in the Settings tab navigation below the Accessibility Checker Settings H1.

Step 3

Check the box for Force Error on Empty Search, then scroll to the bottom of the page and click the “Save Changes” button.

You can test this fix by submitting your search form without any keywords or by adding ?s= to the end of your website URL.

Not seeing the fix?

The Force Error on Empty Search accessibility fix should start working immediately; however, if you don’t see the fix, it could be because you’re seeing a cached version of your website. Try clearing the cache in any caching plugins and on your hosting account, then look at your site in an incognito window to confirm the fix worked.

Note: This fix assumes that your website theme has a search.php template. If your WordPress theme does not have that template, the fix will not work. Learn more about search.php templates here.

What This Fix Does

When enabled, the Force Error on Empty Search fix watches for empty searches and uses PHP to change WordPress’s default behavior. Instead of returning index.php for empty searches, the fix returns search.php, which should show an error message that no content was found.

Example before enabling the fix

Here’s an example of what default WordPress results look like for empty searches:

Search results on the BasikFit website with a heading "Search results for: (nothing)" and three random pages and posts from the website. There is no visible search form.

As shown above, empty searches return a template that resembles your website’s blog template. There is no message communicating an issue with the search, and depending upon your blog design, there may not be a visible search form.

Example after enabling the fix

Here’s what an empty search on this same website looks like after enabling the Force Error on Empty Search fix:

Blank search on the BasikFit website now showing and error message and search form.

With the fix enabled, blank searches now show an error message and show the search form, so users can easily retry their search.

In this example, the error message is:

Sorry, but nothing matched your search terms. Please try again with different keywords.

Note: The search error message is defined by your theme. If you want to change the error message, you’ll need to edit the search.php template in your active theme.

Impact on Accessibility

The goal of Web Content Accessibility Guidelines (WCAG) 3.3.1 Error Identification is that users know an error exists and what is wrong. To pass this success criterion, websites must provide descriptive notification of errors.

Flagging errors clearly helps everyone, both people with disabilities and those without. When websites clearly communicate errors, we can all better understand what happened and how to resolve them.

This fix removes a WordPress behavior that frequently causes confusion and improves usability for all website visitors.

Primary Sidebar

Equalize Digital Accessibility Checker. Start making your WordPress Website Accessible Today. Get Accessibility Checker Now.

Frequently Asked Questions

  • How to Install & Activate Accessibility Checker
  • Getting Started Quick Guide
  • Why Do We Say 100% Passed Checks, Not 100% Accessible?
  • Manual Accessibility Testing: How You Can Check Website Accessibility
  • Dismissing and Reopening Accessibility Issues
  • What to do if There are Accessibility Problems in Your Theme
  • What to do if a Plugin You’re Using has Accessibility Problems
  • How to Get Support for Accessibility Checker
  • Can I Hire Equalize Digital to Fix Accessibility Issues on My Website?
  • Additional Resources for Learning About Accessibility
  • How to Test Accessibility Checker for Conflicts with Themes or Plugins
  • What Does “Unlimited Dev Sites” mean?
  • Is there an Accessibility Conformance Report (ACR) or VPAT available for Accessibility Checker?
  • How does Accessibility Checker align with WCAG?
  • What to do if Accessibility Checker is not Scanning Your Site
  • Known Conflicts
  • Ensuring Accessibility Checker Fixes Work with JavaScript Optimization Plugins
  • How to Use Accessibility Checker to Scan Archive Pages

Rule Documentation

  • A Slider is Present
  • A Video is Present
  • Ambiguous Anchor Text
  • ARIA Hidden
  • Blinking or Scrolling Content
  • Broken ARIA Reference
  • Broken Skip or Anchor Link
  • Duplicate Alternative Text
  • Duplicate Form Label
  • Empty Button
  • Empty Heading Tag
  • Empty Link
  • Empty or Missing Form Label
  • Empty or Missing Table Header
  • Empty Paragraph Tag
  • iFrame Missing Title
  • Image Animated GIF
  • Image Empty Alternative Text
  • Image Long Alternative Text
  • Image Map Missing Alternative Text
  • Image Missing Alternative Text
  • Improper Use of Link
  • Incorrect Heading Order
  • Insufficient Color Contrast
  • Link Opens New Window or Tab
  • Link to MS Office File
  • Link to Non-HTML File
  • Link to PDF
  • Linked Image Missing or Empty Alternative Text
  • Long Description Invalid
  • Low-quality Alternative Text
  • Missing Language Declaration
  • Missing Subheadings
  • Missing Title
  • Missing Transcript
  • Possible Heading
  • Readability & Simplified Summary
  • Tab Order Modified
  • Text Justified
  • Text Too Small
  • Underlined Text
  • Zooming and Scaling Disabled

Easier, Faster Accessibility Testing

Equalize Digital Accessibility Checker gives you real-time accessibility feedback in the WordPress editor. Learn accessibility and make fixes earlier in the dev and content creation process. Full-site accessibility scanning without the per page fees.

Get Accessibility Checker

Footer

Equalize Digital Websites for Everyone

Your WordPress accessibility team. Accessibility plugins, rapid audits, and consulting to help you make your website usable by people of all abilities.

  • Facebook
  • GitHub
  • LinkedIn
  • YouTube

Company

  • About Equalize Digital
  • WordPress Accessibility Meetup
  • Accessibility Statement
  • Blog
  • Events
  • Contact Us

Services

  • Accessibility Audits
  • User Testing
  • Remediation
  • Ongoing Monitoring
  • VPAT & ACR Preparation
  • Accessibility Training
  • For Agencies
  • Website Development

Accessibility Checker

  • Features
  • Pricing
  • Documentation
  • How to Get Support
  • My Account
  • Affiliate Dashboard
  • Become an Affiliate

© 2026 Equalize Digital · Privacy Policy · Terms of Service · Software Terms & Refund Policy

International Association of Accessibility Professionals member