Recommended Free Tools
Add WordPress’s built-in Search block to the archive template in a block theme, or place get_search_form() in the relevant archive template in a classic theme. The form accepts a search term; the archive or search-results template’s Query Loop or PHP Loop determines how matching posts are displayed.
Choose the method that matches your theme
| Route | Use it when | What you edit |
|---|---|---|
| Block theme | You can edit the relevant template in the Site Editor and want to place the form visually. | Add a Search block to the blog archive template. |
| Classic theme | You edit theme PHP files or need to position the form in template code. | Call get_search_form() in the archive template. |
Template names and available controls vary with the theme and site configuration. The WordPress Query Loop documentation describes the block’s post-display controls, while the Query Loop Block Editor Handbook provides additional implementation guidance.
Add search in a block theme
- Open the WordPress dashboard and go to Appearance → Editor to open the Site Editor.
- Open the template that renders the archive you want to change. Depending on your theme and configuration, this may be the blog home or a relevant archive template; names and controls are not universal.
- In the template, select the location for the search field and insert a Search block. A practical layout is an archive heading, the search form, the post list, pagination, and an empty-results message where appropriate.
- Keep the existing Query Loop that supplies the archive’s posts unless you have a specific reason to change it. The Query Loop can use the template’s default query or a custom query; its Post Template controls repeated content such as titles, excerpts, dates, and featured images. Optional Pagination and No Results blocks can provide navigation and an empty state.
- Save the template, then test the archive on the front end.
The Search block adds the control; it does not itself define the archive’s post layout. The Query Loop controls which posts appear and how they are presented.
Add search in a classic theme
- Identify the PHP template that renders the archive where the form should appear.
- At the desired location in that template, add
<?php get_search_form(); ?>. - Use a child theme or another safe theme-customization workflow when editing theme files, so a theme update does not overwrite your changes.
- Check whether the theme already has a
searchform.php. WordPress first looks for that file in the child or parent theme; if it does not find one, it generates default form HTML. - Load the archive on the front end and test a search.
The [WordPress function reference for get_search_form()](https://developer.wordpress.org/reference/functions/get_search_form/) documents the function’s aria_label argument for distinguishing multiple forms and the get_search_form filter for changing generated output. If you need custom markup, use searchform.php or the documented filter rather than scattering a hand-built form across templates. Retain WordPress’s expected search parameter and a usable label.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
Understand what the form does—and what the archive does
A search form submits a term; the template that handles the request displays the matching posts. By default, WordPress’s form submits with GET to the site home URL and sends the search term in a field named s. WordPress uses that query variable to perform the search.
The archive’s Loop is separate: it repeats the content for posts in the page request’s default query. WordPress documents archive examples including category, tag, custom taxonomy, author, date, and search-result pages in its lesson on The Loop. In a block theme, the Query Loop provides corresponding controls for the posts and their repeated presentation. Adding a search box to an archive template does not mean you need to replace its archive query with a new custom list.
Quick Recap
Best Value
Rank #4
Rank #3
Test the archive and search results
- Open the actual archive on the front end and confirm the search control appears where intended.
- Search for a term known to match published content and confirm matching results display.
- Search for a term expected to have no match and check that the page gives visitors a clear empty state. The WordPress.org Documentation guide “Create a search page” uses the message “No posts were found.”
- Check that the archive’s post layout, pagination, and links still work. In a Query Loop, pagination is optional, and titles or featured images may need their link settings enabled.
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.

