WordPress google search plugin

New Page

How to Add Google Search to a WordPress Site

Posted in Marketing, WordPress by WP Engine

Last updated on December 9, 2020

WordPress comes with an easy-to-implement and use built-in search feature. However, when you compare it to popular search engines like Google, the default WordPress offering can leave a lot to be desired.

Fortunately, it’s easy to harness the power of Google by adding a search bar to your website. This powerful and familiar feature will help users find exactly the content they need, improving their experience and increasing key metrics like session duration. 

Contents

1. What are the benefits of adding Google Site Search to your WordPress site?

2. How to add Google Site Search to WordPress with a plugin

2.1. Step 1 – Download a Google search plugin

2.2. Step 2: Manage your Google search settings

23. Step 3 – Add the search bar to your site using a widget

2.4. Step 4 (Optional) – Show search bar using shortcode

3. How to add Google Site Search to WordPress without a plugin

3.1. Step 1 – Visit the Google Custom Search website

3.2. Step 2: Provide your site URL

3.3. Step 3 – Get your custom code

4. Customize your site with WP Engine

In this article, we will discuss two ways to add Google search to your WordPress website. We’ll show you how to add this option to any page or post, and even how to code Google Search into your website theme. Let’s start!

What are the benefits of adding Google Site Search to your WordPress site?

Google is a household name. By integrating a Google search bar on your website, you can help legitimize your business in the eyes of your customers and provide them with a better experience.

The Google search bar is instantly recognizable to many people. There are approximately 40-60 billion searches on Google each month in the United States alone. Most of your visitors will likely have previous experience with the Google search bar. This gives them a smoother user experience as they will immediately know how to interact with your website search.

The Google search bar is reliable and powerful, and it offers a variety of customization options. This includes the ability to limit searches to your website. This can encourage visitors to spend more time on your site, rather than directing them to third-party content.

This feature is also free and easy to implement. In this article, we will share two different ways to add this search bar to your WordPress website. 

How to Add Google Site Search to WordPress with a Plugin

You can add a Google search bar to any page or post using the WP Google Search plugin. This tool allows your visitors to search the entire web, or you can limit the search to a list of approved sites.

You can then add the Google search box to your site using a custom shortcode or widget. Let’s see how this process works, in just four steps.

Step 1 – Download a Google search plugin

Once you have installed and activated WP Google Search, the next step is to sign up for Google’s custom search engine. You can then generate a Google search engine ID, which will allow you to communicate with the Google search service. 

To generate this ID, go to the programmable search engine and select Get Started. Under Sites to search, enter your website URL:

Screenshot of the programmable search engine where you can then generate a Google search engine id Screenshot of the programmable search engine where you can then generate a Google search engine ID

You can then give your search engine a name. Click Save and Google will generate your custom search engine. 

Step 2: Manage your Google search settings

In el menú de la izquierda, select Editar motor de búsqueda > Configuración. Make sure that the pestaña Conceptos básicos is selected:

Change Google search engine settings Modifier la configuration du moteur de recherche Google

Allí puede configurar sus ajustes de búsqueda. Esto incluye habilitar o deshabilitar la búsqueda de imágenes de Google y SafeSearch:

activer ou désactiver la recherche d'images Google et SafeSearch activer ou désactiver Google Image Search et SafeSearch

You can also restrict search results based on region. To do this, make your selection in the Region drop-down menu. You can then select the Restrict search results to region slider: 

Restreindre les résultats de la recherche à la région Restreindre les résultats de la recherche à la région

Finally, you can choose whether to restrict your search to specific websites, or even limit searches to your site only. This can be useful if you want to encourage visitors to explore your content, rather than pushing them towards external resources:

Restreindre la recherche à votre site Restreindre la recherche à votre site

Next, copy your search engine ID and switch back to your WordPress dashboard. You can then navigate to Settings > WP Google Search, and paste that number into the Google Search Engine ID field. 

Step 3: Add the Search Bar to Your Site Using a Widget

You can now add the new search bar to your website, using the WP Google Search widget. Navigate to Appearance > Widgets, find the WP Google Search widget, and drag it to the sidebar where you want to display your search feature:

Ajouter la barre de recherche Google à votre site Ajouter la barre de recherche Google à votre site

You can add a title to your widget, or hide the title completely. Click on Save when you’re ready, and the search bar will appear on your website. Visitors can now interact with Google by typing into the search box. By default, the results will appear as an overlay across your website. 

Step 4 (Optional): Display the Search Bar Using a Shortcode 

What if, instead of adding the search feature to your entire site, you want to display it on specific pages or posts only? To make that happen, you’ll need to use a shortcode instead of a widget.

To get started, open up the relevant page or post for editing. You can then copy and paste the [wp_google_searchbox] shortcode into the exact location where you want to display the search bar: 

Afficher la barre de recherche Code de recherche WordPress Afficher le code de recherche de la barre de recherche WordPress

You can then either publish or update the page or post. Your search bar will appear wherever you placed the shortcode.

You can also insert the shortcode into your website’s theme. This can be a quick and easy way to feature a Google search bar across your website. However, editing theme files can cause issues with your website if you’re not careful. Before making any changes at the code level, it’s always a good idea to create a backup. 

To insert a shortcode into your theme, navigate to Appearance > Theme Editor. Open the Select theme to edit drop-down menu, and choose your current theme:

Apparence > Éditeur de thème WordPress Apparence > Editeur de thème WordPress

Hacia el lado derecho de la pantalla, seleccione el archivo que desea editar. La mayoría de estos archivos se explican por sí mismos: por ejemplo, header.php controla el encabezado de su sitio web. Copie y pegue lo siguiente en su archivo elegido, en la ubicación donde desea que aparezca su barra de búsqueda:

<?php echo do_shortcode(“[wp_google_searchbox] “); ?>

Seleccione Actualizar archivo. La barra de búsqueda se insertará en su tema de WordPress y debería aparecer en su sitio web.

Cómo agregar Google Site Search a WordPress sin un complemento

También puede agregar una barra de búsqueda de Google a su sitio web sin instalar un complemento. En esta sección, le mostraremos cómo reemplazar la barra de búsqueda predeterminada de WordPress con la Búsqueda personalizada de Google. 

Paso 1: visite el sitio web de búsqueda personalizada de Google

Para comenzar, dirígete a la Búsqueda personalizada de Google . En el menú de la izquierda, seleccione Nuevo motor de búsqueda .

Aquí es donde creará su cuadro de búsqueda personalizable. También generará el código que necesita para agregar Google Site Search a su sitio web sin un complemento. 

Paso 2: Proporcione la URL de su sitio

En Sitios para buscar, ingrese la URL de su sitio web. A continuación, puede elegir el idioma de su sitio web y hacer clic en Crear. Google ahora creará su motor de búsqueda personalizado:

Recherche Google programmable Recherche programmable Google

En la pantalla siguiente, seleccione Obtener código. Esto genera el código que necesitará para reemplazar la búsqueda predeterminada de WordPress con la búsqueda de Google. 

Paso 3: obtenga su código personalizado

Ahora puede copiar el código provisto y agregarlo a la plantilla de su sitio web. Recuerde crear una copia de seguridad primero, en caso de que algo salga mal.

Después de crear su copia de seguridad, vaya a Apariencia > Editor de temas y abra su tema para editarlo. A lo largo del lado derecho de la pantalla, seleccione searchform.php . En el editor de archivos, elimina todo el contenido de searchform.php y reemplázalo con el código que copiaste en el paso anterior:

Créer une sauvegarde de site WordPress Créer une sauvegarde du site WordPress

Enregistrez vos modifications en cliquant sur Mettre à jour le fichier. Désormais, chaque fois que les utilisateurs interagissent avec une barre de recherche sur votre site Web, cela les connectera à la recherche Google. 

Personnalisez votre site avec WP Engine

A Google search bar can improve user experience by making it easier for visitors to find interesting and engaging content. However, if you really want to impress your audience, you’ll need a hosting provider that guarantees high levels of security, performance, and reliability.

At WP Engine, we excel in all of these areas. Check out our plans and get ready to take your user experience to the next level!

Plugin tag: Google search

icône-256x256

The SEO Framework – Fast, Automated, Effortless.

(307 ratings in total)

Purely professional, complete and ad-free WordPress SEO plugin. Secure, fast, automated and white hat SEO.…

The SEO Framework Team Over 100,000 active installs Tested with 6.0.2 Updated 4 months ago

icône-256x256

Google WP Search

(28 notes in total)

This plugin offers a very easy way to integrate Google search into your WordPress site.

WebshopLogic Over 10,000 active installs Tested with 6.0.2 Updated 2 months ago

recherche-google-cse_9b9da9

Google WordPress Search

(2 ratings in total)

Add custom Google site search without configuration. Simply drag and drop a widget…

SeedProd 100+ active installations Tested with 3.5.0 Updated 10 years ago

icône-256x256

Google Trends for WP

(3 ratings in total)

Deliver daily trending searches from Google under your editor. WordPress Classic editor required.

Adeleye Ayodeji Over 40 active installations Tested with 6.0.2 Updated 4 months ago

icône-256x256

PRyC WP: excerpt from the Google Sitelinks search box

(0 ratings in total)

Added a plugin to the homepage code required to enable the new sitelink search box in Google Search

PRyC 30+ active installations Tested with 5.9.4 Updated 2 months ago

icône-128x128

Google RDP Custom Search

(1 notes in total)

Google RDP Custom Search lets you use Google’s Custom Search Engine (CSE) API to add…

Robert D Payne 20+ active installs Tested with 4.6.24 Updated 6 years ago

recherche google côté serveur

Server-side Google search

(0 ratings in total)

Adds lightweight Google Custom Search to your website, without the need for JavaScript.

Aptivate 10+ active installations Tested with 4.3.29 Updated 7 years ago

icône-256x256

WP Smart SEO

(0 ratings in total)

A simple SEO plugin that generates for Pages, Articles, Categories:

Eric-Oliver Mächler More than 10 active installations Tested with 6.0.2 Updated 1 week ago

icône-256x256

LC Tracking Codes

(0 ratings in total)

This plugin makes it easy to set up tracking codes on your site.

Luciano Closs Less than 10 active installs Tested with 5.2.16 Updated 3 years ago

icône-256x256

SEO Ready

(0 ratings in total)

A lightweight SEO plugin for generating the most commonly used meta tags, but designed for privacy,…

Mahdi Yazdani Less than 10 active installs Tested with 6.0.2 Updated 2 months ago

icône-256x256

SEO file renaming

(1 notes in total)

A super simple plugin for sanitizing downloaded filenames.

Kinski & Bourke Less than 10 active installs Tested with 5.8.5 Updated 11 months ago

Comment ajouter la recherche Google dans un site WordPress

Last updated on June 2nd, 2016 by Editorial Staff | Reader DisclosureDisclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Shares 385 Share Tweet Share Facebook Messenger WhatsApp Email

Do you want to use Google search on your WordPress site? Although WordPress comes with a built-in search feature, it is not very good. That’s why many site owners add Google site search on their WordPress site. In this article, we will show you how to easily add Google Search in a WordPress site.

Comment ajouter la recherche Google dans WordPress Comment ajouter la recherche Google dans WordPress

Why You Should Use Google Search in WordPress?

The default WordPress search feature is not very useful. It often fails to find the relevant results. This forces site owners to look for alternatives.

There are plenty of search plugins for WordPress like SearchWP, Swiftype, etc. The problem is that you still have to manage them, and they will have an impact on your server resources.

On the other hand, you can use Google’s reliable and powerful search feature instead. It is free, allows you to limit the search to your sites only, and can be run from your own site.

Other benefits of using Google search are speed, users already trust Google brand, and you will not have to maintain or update it.

Having said that, let’s see how you can easily add Google site search to your WordPress site.

To make it easy, we have created a video tutorial on how to add Google search that you can watch below.

Subscribe to WPBeginner

However if you just want to follow text-instructions, then you can follow our step by step tutorial on how to add Google search in a WordPress site.

Method 1: Adding Google Search in WordPress with Plugin

This first method is easier and recommended for beginners. It allows you to add Google search to your WordPress site without modifying your theme files.

First thing you need to do is install and activate the WP Google Search plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » WP Google Search to setup the plugin.

Page de paramètres pour WP Google Search Page de paramètres pour WP Google Search

The plugin will ask you to provide a Google Search Engine id. Here is how you will get a search engine ID.

Visit Google Custom Search website and click on New Search Engine link on the left.

Creating a New Google Custom Search Engine for Your WordPress Site Creating a New Google Custom Search Engine for Your WordPress Site

Simply provide your WordPress site’s URL in ‘Sites to Search’ field. Next, you need to choose the language of your website. Lastly, click on the create button to continue.

Google will now create your custom search engine and will show you a success message with links to further actions. You need to click on the control panel button to continue editing your search engine.

go to the Google custom search engine control panel go to the Google custom search engine control panel

This will take you to the control panel for your custom search engine. First, you need to click on the ‘Search engine ID’ button and copy your search engine ID.

Copy your Google Custom Search Engine ID Copy your Google Custom Search Engine ID

Next, you need to click on the ‘Look and Feel’ section. Under the layout tab, select results only.

Choose the search results page layout Choose the search results page layout

Once you are done, click on the save button at the bottom of the page to store your changes.

Now you can switch back to your WordPress site. Paste the search engine ID you copied earlier in the WP Google Search’s settings page and then click on the save changes button to store plugin settings.

After that you need to visit Appearance » Widgets page. There you will notice WP Google Search widget in the list of available widgets. Drag and drop the widget to a sidebar where you want to display the search form.

Google Custom Search Engine Widget Google Custom Search Engine Widget

Click on the save button to store your widget settings.

You can now visit your website to see the search form in action.

Google custom search form in WordPress Google custom search form in WordPress

Method 2: Manually Adding Google Search in WordPress

This method requires making changes to your WordPress theme or child theme files. It is not recommended for beginners. Make sure to backup your WordPress site before making any changes to your theme files.

Visit Google Custom Search website and click on New Search Engine link on the left.

Creating a New Google Custom Search Engine for Your WordPress Site Creating a New Google Custom Search Engine for Your WordPress Site

Simply provide your WordPress site’s URL in ‘Sites to Search’ field. Next, you need to choose the language of your website. Lastly, click on the create button to continue.

Google will now create your custom search engine and will show you a success message with links to further actions. You need to click on the Get Code button to continue.

Get the code for your Google custom search engine Get the code for your Google custom search engine

On the next screen, you will see some code in a textarea. You need to copy this code.

For this next step, you will need an FTP client. If you need help, then see our guide on how to use FTP to upload WordPress files.

Connect to your website using FTP and then go to /wp-content/themes/your-current-theme/ folder. Replace your current theme folder with the name of your current theme.

Editing the search form file Editing the search form file

Locate the searchform.php file in your WordPress theme directory. Download this file to your computer and open it in a plain text editor like Notepad.

Delete all the contents of the file and paste your custom Google search engine code. Save the file, then upload it to your WordPress site via FTP.

After pasting the custom search code from Google, go to Appearance » Widgets to drag and drop the search widget into your sidebar.

Added a search widget Added a search widget

Click the Save button to save your widget settings.

You can now visit your website to see Google Search in action on your WordPress site.

Customizing Google Custom Search Engine Colors and Appearance

Go to the Google Custom Search website and change your search engine. This will display your custom search engine settings. Click on Look and Feel in the sidebar.

Google Custom Search offers pre-made themes to choose from. You can also click on the Customize tab and choose your own font, border, and background colors.

Customize Google Custom Search colors and appearance Customize Google Custom Search colors and appearance

Once you’re done customizing the look of your search box, simply save your changes. You don’t need to re-paste the code, these modifications will be automatically applied to your search form.

We hope this article helped you learn how to add Google Search to a WordPress site. You can also check out our list of 19+ free Google tools every WordPress blogger should use.

If you liked this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Shares 385 Share Tweet Share Facebook Messenger WhatsApp Email


Video WordPress google search plugin

Related Posts

Automatically update wordpress plugins

Contents1 WordPress® Automatic Updates – Should You Use Them?1.1 The Benefits of WordPress Automatic Updates1.2 The problem with WordPress automatic updates1.3 What if the automatic update breaks…

WordPress mortgage calculator plugin

Contents1 Etiqueta del complemento: hypothetical calculator1.1 Calculadora de hipoteca receptiva1.2 mortgage calculator1.3 Calculadora de hipotecas / Calculadora de préstamos1.4 WordPress Estatik Mortgage Calculator1.5 Simple Mortgage Calculator1.6 WP…

WordPress responsive menu without plugin

New Page How to Create a Mobile-Ready Responsive WordPress Menu Last Updated OnOctober 3, 2016by Editorial Team | Reader Disclosure Disclosure : Our content is endorsed by…

Gravity forms wordpress plugin

Contents1 Etiqueta del complemento: formas de gravedad1.1 Armadura WP – anti-spam honeypot1.2 Spam-Free Gravity Forms1.3 Seguimiento de events para formularios de gravedad1.4 Severity Shapes + Custom Post…

WordPress plugin fundraising thermometer

Contents1 donation termometer1.1 ¿Cómo uso los valores dinámicos?1.2 The [therm_r] and [therm_t] shortcodes show different values to the thermometers.1.3 Can I display the thermometer as a percentage…

Calculator plugin for wordpress

New Page Top 12 Calculator Plugins for Your WordPress Site Last updated August 7, 2020 by Editorial Team | Reader Disclosure Disclosure : Our content is reader…