Google search in website setups work by embedding Google's Programmable Search Engine: a free tool that puts a search box on your pages and answers it from Google's index of your site. The licence costs nothing, but it still sits inside the wider cost of a website in South Africa, and press reports say Google narrowed the product for new engines in 2026.

This guide gives you the embed code from Google's own documentation, what the free version now does and does not offer, and a decision table for choosing between the Google box, a plain link, your platform's built-in search and Google's paid enterprise route. It also covers the question most tutorials skip: whether your site needs a search box at all.

Quick Answer

To add Google search to website pages, create a search engine in Google's Programmable Search Engine control panel, list your domain under "Sites to search", then paste the generated script and a gcse-search div into your page. In 2026 the free version still works for a single site but shows ads (the non-profit version is ad-free), and Google's documentation says the ad-free paid option is closed to new customers. For small sites, a clear menu is often enough without a search box.

Not sure your site needs a search box?

Send us your site address and we will tell you whether search, navigation or content structure is the real fix.

Get a Quick Site Review

What Is Google Search in Website Form, and How Does It Work?

Google search in website form is a search box on your own pages whose results come from Google's index rather than from your site's database. Google's Programmable Search Engine, formerly Custom Search, lets you build customised search for a website, a blog or a group of sites, with control over how results look and rank.

Technically it is two pieces: a script tag that loads Google's search JavaScript, and a div that marks where the box and results appear. Because Google's JavaScript loads asynchronously, your page keeps loading while the browser fetches it. Older tutorials call the same product a Google custom search engine or Google site search; the current name is Google Programmable Search Engine.

The appeal is obvious in South Africa, where Statcounter put Google at 92.89% of search engine use in October 2026. Visitors already trust the way Google results look, and you do not have to build or host a search index yourself.

What Changed in 2026 for New Engines

According to the technology publication Heise's report on Google's 2026 change, new Programmable Search Engines can only search up to 50 domains and the "search the entire web" option is gone for them. Heise adds that existing engines covering more than 50 domains or the full web must switch to an alternative by 1 January 2027, and that the free "Sites to search" option for up to 50 domains remains. Google's own overview page, which we checked, does not spell these points out, so treat them as reported rather than documented.

Two paid doors have closed. Google's documentation says the ad-free Paid Search Element, priced at $5 per 1,000 queries (about R82 per 1,000 queries at the R16.42/USD assumption used in the SA Digital Cost Index, August 2026), is closed to new customers. The Custom Search JSON API is also closed to new customers, with existing users told to move by 1 January 2027.

What a New SA Site Gets in 2026

Google search in website form is still available to a new site: it can embed the free Programmable Search Engine for its own domain, with ads in the results (unless it qualifies for the non-profit version). The ad-free paid element and the JSON API are both closed to new customers, and Google points developers who need more toward Vertex AI Search, an enterprise cloud service.

Adding the Search Box: Six Steps

Adding the search box means creating an engine, scoping it to your domain, and pasting two snippets into your pages. You need access to edit your theme or page templates; if you do not have it, the person who does will need only the two snippets below.

  1. Open the control panel. Go to the Programmable Search Engine site and choose "Get started", signed in with a Google account your business controls, not a freelancer's personal one.
  2. Add your domain. In the Basics tab, under "Sites to search", enter your site. Google's help page suggests keeping an engine to no more than 20 unique sites, as a performance recommendation; the 50-domain cap reported for new engines is a separate, harder limit. A single business site is far inside both.
  3. Copy the code. The control panel generates a script containing your engine ID (the cx value). Copy Google's generated snippet rather than retyping the example below.
  4. Paste the script into the <head> of every page that carries the box.
  5. Paste the div where the box and results should appear.
  6. Test with real queries that customers use, including product or service names, on a phone as well as a desktop.

The Two Snippets (from Google's documentation)

<script async src="https://cse.google.com/cse.js?cx=YOUR_ID"></script>

<div class="gcse-search"></div>

Replace YOUR_ID with your engine ID. Source: Google's search element documentation.

The single div gives a full-width box with results beneath it. For a box in your header and results on a dedicated page, Google documents a split layout: use gcse-searchbox-only where the box goes, a data-resultsUrl attribute on the box naming your results page, and gcse-searchresults-only on that page. For two-column layouts both the box and the results elements must be present, and Google notes that multiple search elements can be added to one page.

Which Search Option Fits Which Site?

The right search option depends on how many pages you have, whether visitors search for products or for answers, and who maintains the site. Four options remain realistic for a new South African site in late 2026.

OptionWhat it isCost positionBest for
Google Programmable Search Engine (free)Embedded box, results from Google's index of your domainNo licence fee; ads appear in results (the non-profit version is ad-free)Content sites and brochure sites that want a quick box
A "site:" linkA link that opens Google with site:yourdomain.co.za typed inFree; no code to maintainTiny sites, as a stopgap; visitors leave your site
Built-in platform searchThe search your CMS ships with; WordPress, for example, outputs its own form via get_search_form()Free, runs on your own siteSites where results must reflect live content or products
Vertex AI SearchGoogle's enterprise cloud search service, Google's suggested alternative for developers leaving the JSON APIPaid cloud service; not a free embedLarger organisations with a developer to integrate it

The "site:" route relies on Google's own operator: typing site: before a domain restricts results to that site, with no space after the colon. It needs no engine and no code, but it hands the visitor to Google's results page and away from you.

For online stores, search quality drives revenue directly and the embedded Google box is rarely the right tool; our notes on ecommerce onsite search best practices cover what a shop needs instead.

What the Embedded Google Box Will and Will Not Do

The embedded box searches Google's copy of your site, so it can only be as complete and as current as that copy. Google says an engine's results "are unlikely to match those returned by Google Web Search", so do not promise yourself that a page you can find in Google will appear in your box.

Three limits follow, each with a practical response:

Weak plan: paste the script, announce "search now live", and never test. Visitors search for a service you added last week, Google has not indexed that page, and the box returns nothing. Test with your newest pages before you launch.

Pages missing from your search results?

Send us your domain and we will check whether the gap is indexing, structure or the search tool itself.

Request a Search Audit

Privacy: Disclosing a Google Search Box Under POPIA

A Google search box adds a third-party service to your pages, and the questions it raises under POPIA are whether a visitor's query is personal information and whether your site is the one transferring it. POPIA section 72(1) states that a responsible party in the Republic may not transfer personal information about a data subject to a third party in a foreign country unless one of the listed grounds applies, such as consent or adequate protection under law or agreement. We read that text on a secondary site, not the Act itself.

Section 72 bites only if the query counts as personal information and the transfer is yours; a browser connecting directly to Google is arguably not your transfer, and a short search phrase is not always personal information. That is a question for your own legal adviser, not a blanket yes or no. As good practice rather than a s72 requirement, name Google as a search provider in your privacy policy, noting that queries may be processed outside South Africa, and review third-party scripts on the site each year.

Do You Actually Need a Search Box?

A site needs a search box when visitors arrive with a specific item or question and the menu cannot reach it in one or two clicks. For a brochure site with a handful of services, a clear menu and a contact button usually serve visitors better than a search field they will not use.

As a working rule of thumb, not a measured threshold: add search when you have enough pages, products or articles that a first-time visitor could not list them from your menu. Below that, the effort is better spent on page titles, navigation and the running costs covered in what a website costs to run per year. If budget shapes the decision, cheap versus expensive websites compares what different price levels buy.

If you do add one, put the box where people look for it, usually the header, and track what visitors type. Zero-result searches tell you which pages or products you are missing.

Search Box or Better Navigation?

Add a search box when your catalogue or archive is too big to browse from the menu. Otherwise, fix navigation and page titles first, because an embedded Google box depends on Google having indexed your pages and, in the free version, shows ads.

Why South African Businesses Choose Growth Pulse Media

Growth Pulse Media is a Johannesburg agency founded by Dirk van Greuning, who built and scaled a large South African ecommerce business before starting the agency. All work is executed in-house, and a limited client load keeps senior attention on every account.

For a decision about Google search in website pages, that means a straight answer on whether to embed Google, use your platform's search or skip search altogether, alongside the wider web design choices it depends on. We can also check indexing and tracking in Search Console and GA4, which decides whether Google's box has anything to show.

Want a second opinion before you paste any code?

Book a no-obligation chat and we will map your site's search needs to the right option and a realistic effort.

Book a Free Consultation

Who This Is Not For

Online stores needing live stock and prices. An embedded Google box answers from Google's index of your pages rather than from your product database, so live stock is unlikely to show. You need search built into your store platform.

Sites that cannot show ads. If third-party adverts inside your search results are unacceptable, the standard free version is not for you. The ad-free paid element is closed to new customers, and the ad-free non-profit version is for eligible organisations only.

Very small sites. If your whole site is a handful of pages, a clear menu does more than a search field, and the code is one more thing to maintain.

Frequently Asked Questions

How do I add Google search to my website?

Create an engine in Google's Programmable Search Engine control panel, add your domain under "Sites to search", and copy the generated script and div into your pages. The script goes in the head and the gcse-search div goes where results should appear. Test it with your newest pages.

Is Google search on my website free?

The standard Programmable Search Engine has no licence fee but shows ads in results; the non-profit version is ad-free. Google's documentation says the ad-free paid element and the Custom Search JSON API are closed to new customers, so a commercial site cannot buy its way out of ads at the time of writing.

Can I search only my own website with Google?

Yes. List only your domain under "Sites to search" and results are restricted to it. For a quick alternative without an engine, a link to Google with site:yourdomain.co.za typed in gives a similar result but a different experience: it is Google's own results page, not a search box on your site.

Why are some of my pages missing from the search results?

The box answers from Google's index of your site, so a page Google has not indexed is unlikely to appear. Google says a sitemap does not guarantee every URL is crawled and indexed. Check indexing in Search Console and make sure the missing pages are linked from your menu or other pages.

What changed with Google Programmable Search Engine in 2026?

Heise reports that new engines can search a maximum of 50 domains and can no longer search the entire web, and that existing engines above that scope must switch to an alternative by 1 January 2027. Google's documentation confirms the JSON API is closed to new customers. Searching a single site with the free version remains available.

Get Search That Actually Finds Things

Whether you embed Google, use your platform's search or fix your navigation instead, we will tell you which fits your site, and what it will take. No obligation. We will get back to you within 24 hours.

Get Your Free Consultation
Dirk van Greuning — Founder, Growth Pulse Media
Dirk van Greuning Founder, Growth Pulse Media

Founder of Growth Pulse Media and a specialist in South African search dominance. Dirk translates his experience in scaling South African businesses into high-velocity digital strategies for B2B and retail leaders. He writes about SEO, lead generation, and paid media from an operator's perspective — prioritising pipeline value over impressions.

Connect on LinkedIn