Categories

Featured templates

WordPress. How to add a search form and edit search results page

Norman Fisher January 2, 2020
Rating: 3.3/5. From 6 votes.
Please wait...

This tutorial is going to show you how to add a search form & edit search results page on your WordPress template.

How to add a search form

Log into your WordPress admin panel and go to the left-side menu Appearance -> Widgets.

  1. Under the Available Widgets locate a one called Search (A search form for your site) and drag it to one of the boxes available on the right side (depends on the particular template design)
  2. When needed, specify a title for your Search form and click Save.
  3. Preview the page which has the widget position with the Search form enabled to see it there.

How to edit the search results page

  1. In your WordPress admin panel go to Appearance -> Editor.
  2. From the right-hand side of the Edit Themes page look for the one called Search Results (serach.php) and click on it. The search.php is a template file that represents a template that displays the search results.

  3. Search Form (searchform.php) you can also select from the right side represents another template file that is often included to the sidebar of many themes and generates the search box form. If there isn’t one in your theme, you can easily copy it from the Default theme.
  4. Prior to making any changes to the code of these pages, we suggest that you copy it and save in a file on your computer to have for a backup copy.
  5. The way you need to customize the search results page is totally up to you. For instance, your default search results pages look like this:
  6. You can look for the text you see on this page (like: Search for, Read More, Older Entries, Newer Entries etc) in the code by hitting Ctrl + F.
  7. To disable text, for example, the one that says No comments, first look for the text with Ctrl + F to find the line it is in, which is
    <?php comments_popup_link('No comments', '1  comment', '% comments', 'comments-link', 'Comments are closed');  ?>

    And delete it (comment it out).

  8. To change the number of search results, put
    <?php query_posts('showposts=#'); ?>

    above

     <?php if (have_posts()) : while  (have_posts()) : the_post(); ?>

    where # is the number of posts.
    To remove the footer sidebar, remove <?php get_footer(); ?> at the bottom.

  9. To display the number of results, change
    <h1>Search for: "<?php the_search_query();  ?>"</h1>

    to

    <h1>Search for: "<?php /*  Search Count */ $allsearch = &new  WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1);  $count = $allsearch->post_count; _e(''); _e('<span  class="search-terms">'); echo $key; _e('</span>'); _e(' —  '); echo $count . ' '; _e('articles'); wp_reset_query(); ?></h1>
  10. Once you are done with your changes, click on Update File at the bottom to save them and try use the Search box on your site:

Feel free to check the detailed video tutorial below:

WordPress. How to add a search form and edit search results page

I hope you succeeded in creating a WordPress search page and now everything works great. If not, you can use professional website support to edit your WordPress page. Such service helps you to fix some bugs on your website or just support your website to function on a monthly basis.

Whether you are a beginner or a professional, there will be times when you need help with WordPress. After the launch of the site, everybody someday needs to provide high-quality and timely technical support.

What happens without timely technical support?

  • technical errors and bugs appear on the site. This annoys users and forces them to leave you and go to competitors;
  • the site is idle due to periodic hosting problems;
  • goods and information about services are not updated on time;
  • while competitors create new pages, banners and gather an audience, your site suffers from the unknown bug.

We suggest relying on professionals from the WordPress Website Maintenance & Support from TemplateMonster to help you with your WordPress search page and other services.  As a comprehensive site maintenance company with 10 years of experience, we offer two tariffs, depending on the amount of work.

What are the Conditions of WordPress Website Maintenance?

By purchasing this service, you are guaranteed to get an optimized working site that is protected from hacker attacks and hacks, as well as its further support on the way to high ratings.

At the same time, you don’t need to worry about anything yourself. You give the “keys” of your site, the rest is the concern of specialists. Of course, as the owner, you will retain access to everything. You will also receive monthly reports on the activities of the service.

Okay, you know already that our service can help you to create/edit a WordPress search page.  But what exactly it can do?

Main features:
  • Daily and weekly backups
  • Structure, usability and SEO optimization
  • Uninterrupted monitoring of the site 24/7
  • Speed up site performance
  • Hosting with InMotion
  • Site Security and Protection Package

What pricing plans this service has?

The Essential plan costs $289 a year and $39 a month. It allows you to forget about the routine processes of website content. Effective monitoring allows you to track problems on the site and quickly fix them.  It is suitable for supporting small sites that have a representative function. Friendly and efficient support is available around the clock. They will help you to edit WordPress pages and customize it any time you need it.

The Premium plan costs 689 dollars a year or 69 dollars a month. It is designed for a business that attracts customers via the Internet. The price includes both information support of the site, and any changes in the functionality and appearance of the project. This plan is also perfect for online stores.

In addition, this WordPress site maintenance plan has a number of additional advantages.
  • Remote technical support.
  • Site transfer.
  • Security measures.
  • Installing the theme.
  • SEO consulting and basic setup.
  • Integration with Google Analytics.
  • WooCommerce support.
  • All important plugins.
  • Weekly speed optimization.

How to get started with the website maintenance service?

First of all, in order to become a client and take advantage of all the site support services, you should choose a plan. Then fill in three fields – email, name, and phone. Choose a payment method, and actually pay the required amount. After that check your mail.

A confirmation letter will be sent to your address. And then a manager will contact you, with whom you can discuss all the nuances of your cooperation and give access to your site.

That’s the whole procedure.

Find out more about how to manage WordPress Website Maintenance at our blog.

Best Paid Wordpress Themes
This entry was posted in WordPress Tutorials and tagged results, search, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket