Google Programmable Search Engine
This module allows the Drupal core search form to return site-specific search results from Google. You control which site(s) are indexed. It supports all configuration provided by the Programmable Search Element API. Theming is the responsibility of the site owner.
Background
Basic Setup
1. Install this module as you normally would.
2. Create a new Google PSE instance at https://programmablesearchengine.google.com/about/
3. Go to Configuration > Search Pages (/admin/config/search/pages) and create a new search page of type "Google PSE search". Enter the PSE ID from the previous step.
4. Place the core Drupal "Search" block in your layout. Searches will return results from Google.
Additional settings through Google's Element Control API
You can use optional attributes to overwrite configurations created in the Programmable Search Engine control panel. For example, including data-lr="lang_fr" will restrict results to documents written in French.
Some more common settings available through this interface:
- Customize the "no results" message
- Open results in a new tab/window
- Restrict results to pages from a specific site
- Restrict results to matches in a specific language
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.