Hello dear developer,
Today I bring you a special tip: let’s learn how to insert a Google search box that will show your site’s search results directly in Google. This way, your visitors can search for specific content on your site using Google’s search power.

How Does It Work?

The search box we’re going to add will direct searches to Google, but it will only display results from your own domain. This is possible using the site: command in Google searches.

Step by Step

1. Copy the Code Below

Insert this code anywhere' on your site (Wapkiz, Wapka, Wapaxo, XtGem, or blog):

<form method="get" action="https://www.google.com/search"> <input type="text" name="q" placeholder="Search the site..."> <input type="hidden" name="q" value="site::site_url:"> <input type="submit" value="Search"> </form>

Final Result

The form will display a search box with a “Search” button. When visitors enter a term and click, they will be taken to the Google results page, limited to your site.

Like this:

  • Visitors type a search term in the box.
  • Google returns results only from your site.
  • Simple, functional, and straight to the point.

Extra Tip

You can style the search box with CSS to make it look nicer and match your site’s design.