WordPress’s built-in search is basic: it often ranks results by date rather than relevance, does not correct spelling, and struggles on large sites. Google’s free Programmable Search Engine (formerly Google Custom Search) gives your readers Google-quality results from your own site, and you can earn money from search ads by connecting AdSense.
Here is how to add it to WordPress in 2026, step by step.
Step 1: Create a Programmable Search Engine
- Go to programmablesearchengine.google.com and sign in with your Google account.
- Click Add (or Get started).
- Name your search engine, for example your blog name.
- Under What to search, choose Search specific sites or pages and enter your domain, such as
yourblog.com/*. - Complete the check and click Create.
Step 2: Choose How Results Appear
Open your search engine, go to Look and feel, and pick a layout. For a blog, Results only is the cleanest: you place a search box in your sidebar or header, and results appear on a dedicated search page on your site, so visitors never leave. Adjust colors to match your theme and save.
Step 3: Connect AdSense to Earn From Searches (Optional)
In the control panel, open the monetization or AdSense section and link your AdSense account. Search ads then appear above your results, and you earn when visitors click them. You need an approved AdSense account; see how to get AdSense approval.
Step 4: Create a Search Results Page in WordPress
- In WordPress, go to Pages > Add New Page and title it “Search Results” (the URL will be something like
yourblog.com/search-results/). - In the Programmable Search control panel, open Overview and copy the code, or the results element code if you chose Results only.
- Add a Custom HTML block to your page and paste the code.
- Publish the page.
Use a slug like search-results rather than /search/, because /search/ is reserved by WordPress for its own search.
Step 5: Add the Search Box to Your Site
In the control panel, set the results page URL to your new page, then copy the search box code. Add it where you want the box to appear:
- Block themes: go to Appearance > Editor, open your header or sidebar template, and add a Custom HTML block with the code.
- Classic themes: go to Appearance > Widgets and add a Custom HTML widget to your sidebar.
Remove WordPress’s default Search block or widget so visitors do not see two search boxes. Test a search to make sure results load on your page.
Is Google Search Better Than WordPress Search?
- Pros: relevant results, spelling suggestions, fast, free, and optional ad revenue.
- Cons: only shows pages Google has indexed, new posts can take time to appear, the free version shows Google ads, and styling is limited.
Alternatives include search plugins such as Relevanssi or SearchWP that improve WordPress’s own search without relying on Google.
Frequently Asked Questions
Is Google Custom Search still available?
Yes, under the name Programmable Search Engine. It is free with ads, and you can connect AdSense to earn from those ads.
Can I remove ads from Google search results on my site?
Free search engines show ads. You can earn from them by linking AdSense.
Why are my newest posts missing from search results?
Programmable Search uses Google’s index, so new posts appear only after Google indexes them.
Leave a Reply