> For the complete documentation index, see [llms.txt](https://documentation.ajaxsearchpro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ajaxsearchpro.com/getting-started/search-as-menu-item.md).

# Search as menu item

How to place the search into a menu

## Recommended Method

Open up the **Appearence -> Menus** page and make sure the Ajax Search Pro is enabled on the screen options.

<figure><img src="https://1706764988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9jkFgNo4lpUof35gvS%2Fuploads%2FvqU9q1rAibeez47fEJlO%2Fimage.png?alt=media&amp;token=a218b56a-5c0d-4146-b433-04b90687ab30" alt=""><figcaption></figcaption></figure>

Under the **Appearence -> Menus** on the left side there will be an Ajax Search Pro menu group.

<figure><img src="https://1706764988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9jkFgNo4lpUof35gvS%2Fuploads%2F0aiD5gXoUppxhmqJ0JLd%2Fimage.png?alt=media&amp;token=7bf156ba-68aa-46e3-ab48-dd9e65920dda" alt=""><figcaption><p>Ajax Search Pro menu element</p></figcaption></figure>

After clicking the *Add To Menu* button, a new menu item will be added to the menu. In this menu element you can choose which Search instance should be used.

<figure><img src="https://1706764988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9jkFgNo4lpUof35gvS%2Fuploads%2FOzGaghOXXbrkRpKoQSXq%2Fimage.png?alt=media&amp;token=c99b2e7f-7f1e-4484-8a38-31b233f15abb" alt=""><figcaption></figcaption></figure>

### Menu Attributes

* &#x20;<mark style="background-color:purple;">Search</mark>  (drop-down) - To select which search instance should be used
* &#x20;<mark style="background-color:purple;">Prevent custom script events</mark> (checkbox) - If selected, the plugin will try to prevent custom events attached to the parent menu item. It may help in cases where menu has custom redirection or hover related events attached.

## Legacy Method via shortcode

It is possible to use the search box shortcode in a menu as the title field. The menu item will be automatically replaced with the search bar. This simple guide will help you achieve that.

1\) Under the **Appearence -> Menus** submenu open up (or create) the menu you want to edit.

![](http://i.imgur.com/QqCp0qu.png)

2\) Click on the **Custom Links** item and as the *URL* enter anything (I used the '#' character in this example), and as the *Link Text* paste the search shortcode, then click the **Add to Menu** button.

![](http://i.imgur.com/n1ty3oB.png)

3\) That's it. The menu item is created, now you can move it like any other one.

![](http://i.imgur.com/60g2eJe.png)

4\) **Make sure to save the menu**, and the search should appear as a menu item on the front-end.

![](http://i.imgur.com/8ZlPWoY.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.ajaxsearchpro.com/getting-started/search-as-menu-item.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
