<p>Give this a go:</p>

<pre><code>{% set searchTerm = craft.request.getParam('q') %}    
{% set query = craft.entries({
        search: 'title:*' ~ searchTerm ~ '*',
        limit: 5,
        locale: craft.locale,
        order: 'score'
    }) %}
</code></pre>

<p>You can leave out the <code>*</code> on both sides if you only want to search for full word matches. Also, this might help you take it further: <a href="https://craftcms.com/docs/searching" rel="nofollow noreferrer">https://craftcms.com/docs/searching</a> </p>

CC BY-SA 3.0
2017-05-05T12:10:08.727Z
That did the trick. Couldn't figure it out straight from the docs though.
Justin Dekkers
CC BY-SA 3.0
2017-05-05T11:00:02.180Z
2017-05-05T11:00:02.180Z
ijust
<p>I have a vacancy's website which has a couple of search forms spread around the website. The craft standard search form works great, the only problem is I need to search only by the <strong>title field</strong> instead of all the content in the entries. </p>

<p>So my question is..</p>

<p><strong>Is it possible to search only by title field?</strong></p>

<templating><search>
Search only by Field instead of entire content
# Search only by Field instead of entire content

(Asked by: username_0 on 2017-05-05)

I have a vacancy's website which has a couple of search forms spread around the website. The craft standard search form works great, the only problem is I need to search only by the **title field** instead of all the content in the entries.

So my question is..

**Is it possible to search only by title field?**

**Tags:** templating, search

---

## 1 answers

### Answer by username_1 on 2017-05-05. Score: 3 | Accepted answer

Give this a go:
{% set searchTerm = craft.request.getParam('q') %}    
{% set query = craft.entries({
        search: 'title:*' ~ searchTerm ~ '*',
        limit: 5,
        locale: craft.locale,
        order: 'score'
    }) %}

You can leave out the * on both sides if you only want to search for full word matches. Also, this might help you take it further: https://craftcms.com/docs/searching

> **Comments:**
> **username_0**: That did the trick. Couldn't figure it out straight from the docs though.  

---

