Create and set up search

It takes five steps to create a search. You set up the search area, the search form appearance, and the search results. As a result, you get an HTML code to embed on your site.

Step 1. Search area

Specify the search area (pages that the search is limited to), the search names, and other general properties.

Alert

The rights to all sites in the search area must be confirmed in Yandex Webmaster.

Technical search name

The name that's displayed on the My search boxes page. Only you can see it.

Search name for the OpenSearch standard

You can set the search name for OpenSearch. Visitors will be able to add your search to the browser as a search engine using that name.

If you created a search before Yandex Site Search began to support OpenSearch, your search was automatically assigned the name "Yandex Site Search #2023403". Change it to reflect the search purpose better.

Family filter

Specify the search area (pages that the search is limited to), the search names, and other general properties.

To exclude pages with obscene language and pornography from the search area, set up a family filter. The filter settings are similar to the main search settings.

Search area

Note

Your search topics will only apply to the searches already created. Categories and topics are no longer available for new searches.

Set the search area — a list of sites that'll be included in the search. You can specify up to 50 site or section addresses.

  1. Click Add sites and exclusions.

  2. List the site or section addresses, separating them by a space.

  3. Set up exclusions.

  4. Click Add.

Subdomain search
By default, search is performed in all the listed addresses and their subdomains. For example, if you add a mysite.com website, thesubdomain.mysite.com address is also included in the search area. To exclude subdomains, switch the option to .

Exclusions

You can exclude certain pages from the search area. Exclusions are taken into account for the entire search area, including search topics.

In the list of exclusions, you can enter the exact document addresses or an address mask to exclude entire site sections. For example:

  • Exclude the somepage.php page of the example.com site: http://example.com/somepage.php

  • Exclude all the /blog/ section pages of the example.com site: http://example.com/blog

If you already entered the site manually, you can add and remove exclusions in the Exclusions section in the same way as sites.

If your search area consists only of search topics, you can specify exclusions by clicking Add sites and exclusions.

Step 2. Search form

Set up the search form appearance. The settings are automatically applied under the Search form preview heading, where you can see what the form looks like on your site. Note: on your site, the form will automatically stretch to the width of the available space.

Note

The form background is transparent by default. That way, you don't need to think of a color that matches the color scheme of your site.

The code of the resulting form is available at the last step of search creation.

Step 3. Search results

Set up the search results. Decide which page the search results must be displayed on (see the Display results section).

Two options are available:

  • On the Yandex page, with your logo, header, and footer (Show results on Yandex).

  • On your site page (Show results on my own page). If you select that option, specify the URL of the page that will contain the search results code. The code will be available at the last step of search creation.

Your search result settings (colors, texts, and font styles) are automatically reflected under the Search results preview heading.

Step 4. Search check

Check the search that you set up. The form appearance must match the parameters you specified, and the search results can't include anything outside the specified search area.

If the search or form doesn't work as you expected, double check your settings from the previous steps. If the error persists, contact us, specifying your username and name of the faulty search.

Step 5. Embed code

Get the search form and search results codes (if you want to display the search results on your site).

Select the encoding and language

Yandex automatically detects the site encoding, but if automatic detection fails, you can specify your text encoding manually.

The choice of language affects the following search parameters:

  • The language of the search results and the search form.
  • The search area and result ranking (a query in English is more likely to return pages in English).
  • The language of search suggestions that are generated by default.

Search form code

When you select the search form language, you can copy the code and paste it into your site page HTML code.

The Yandex Site Search form code is in the <div> element with some CSS classes. If you don't like the suggested design options, you can customize the form appearance using CSS: describe the styles in the <style> element after the form code.

Search results code

If you selected Show results on my own page in the search result settings, you'll get the search results code. Embed the code in the HTML code of the page where you want to display the search results.

Yandex Site Search offers two search results codes:

  • IFRAME

    In the simplest option, the code creates an <iframe> element where the results are displayed. This is more compatible with complex website design, but you can't customize the search results appearance in a flexible way.

  • HTML & CSS

    The search results code embeds the entire HTML code into your page structure. The search result elements will be designed according to your common CSS styles.

    If you can customize CSS settings, you can make the search result appearance match your site design. Select the Add CSS to results code option, and the CSS code for all results styles will be added to the results code.

    You can also use the HTML & CSS option to get links to a specific search results page or to search results with constraints. To use this feature, enable the Edit webpage hash settings when browsing search results option.

    Alert

    If you use your own hash parameters, the setting may conflict with the search results code. In that case, you may want to disable the setting.

Further setup

The created search will appear in the My search boxes list. When you open the search page, you can change all the parameters that you set up earlier, as well as configure the search suggestions, snippets, and search constraints.

Contact support