How do I change this template code to only return results from the title field of an entry?

The search result page url would look like this: /search-results?q=joe+blogs

{% set query = craft.request.getParam('q') %}
{% set entries = craft.entries.section('not thisSection').search(query).order('score') %}

Thanks for any help.

1 Answer 1


This seems to work:

{% set entries = craft.entries.section('not lakeDetails').search('title:' ~ query).order('score') %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.