On this page
A custom search engine URL template lets you type a shortcut and a search phrase in your browser’s address bar, then send the phrase directly to a chosen search site. This tutorial explains how to build a template, try it in desktop Chrome, and check whether special characters are handled correctly.
Verification note: Current browser documentation was not available for this article, and the setup and test searches were not run. Chrome’s menus and placeholder behavior may change, so check the browser’s current help documentation if the steps do not match your installation.
Key Takeaways
- A search template combines a search URL with a placeholder where the browser inserts your query.
- Desktop Chrome commonly uses
%sas the placeholder; other browsers may use different syntax or offer different setup options. - The browser should encode the query when substituting it into the URL. Don’t manually encode the
%splaceholder. - Test spaces, ampersands, and non-Latin characters before relying on a template.
How a custom search engine URL template works
Consider this illustrative template:
https://example.com/search?q=%s
https://example.com/searchis the search page.qis the query parameter used in this example.%smarks where the browser should insert the search phrase.
example.com is a fictional example for this purpose, not a search service to configure. Real sites can use a different path or parameter name, and not every site supports searching through a URL.
When substitution works, a search such as red fox becomes the value of the query parameter rather than the literal text %s. The browser is responsible for inserting and encoding the phrase; the template supplies the destination and placeholder.
Advertisement
Find a search URL
- Visit the search site you want to use and run a search for a distinctive, harmless word such as
tidysearchtoken123. - Look at the resulting address. For example, a site might produce an address shaped like
https://example.com/search?q=tidysearchtoken123. - Identify the part containing your word. In this example, it is the value of
q. - Replace only that word with the placeholder required by your browser. For the Chrome example below, the resulting shape is
https://example.com/search?q=%s.
Use the real address from your chosen site, not the fictional example. Some addresses contain extra parameters; keep them initially, then remove unnecessary ones only if you can confirm searches still work. Check that the hostname is the site you intended to use.
If the search phrase does not appear in the address, the site may submit searches in another way. In that case, this URL-template method may not work; check the site’s own instructions rather than guessing a URL.
Add the template in desktop Chrome
These are general steps for Chrome’s search-engine settings, not a verified description of the current interface:
- Open Chrome’s Settings and look for Search engine. Find the area for managing search engines and site search. If the labels differ, search Settings for “site search.”
- Choose the option to add a site search or search engine.
- Enter a recognizable name and a short, unique shortcut, such as
recipes. - In the URL field, paste the search URL you found and replace the sample query with
%s. - Save the entry. In the address bar, type the shortcut and use the browser’s displayed prompt to activate it, then enter a search phrase.
If Chrome rejects the entry or opens the placeholder literally, check its current help documentation for the required syntax and setup steps. Avoid assuming that instructions for Chrome apply unchanged to another browser.
Check encoding with three searches
Encoding keeps query text from being mistaken for URL structure. In particular, an unencoded & can be interpreted as the start of another query parameter rather than part of the search phrase.
Try these phrases using your shortcut:
red fox— check that both words arrive as one search phrase. The space may appear as%20or+in a query string.cats & dogs— check that the site receives the ampersand as part of the phrase. An encoded ampersand is%26.café 猫— check that both the accented character and the non-Latin character survive. A UTF-8 percent-encoded representation of this phrase iscaf%C3%A9%20%E7%8C%AB.
These are expected representations, not observed test results. A search site may rewrite its address or display a decoded form, so judge both the URL and the phrase shown by the search site. If you need to inspect the actual request, use your browser’s developer tools on a search you are authorized to perform.
Put %s in the template as-is; don’t replace it with %25s or pre-encode every search phrase. If the browser or site mishandles a phrase, first check the template and the browser’s current documentation. Manually encoding input can cause double encoding if the browser encodes it again.
Advertisement
Common Mistakes
- The wrong host opens: Check the hostname in the saved template, including spelling and any redirects. Recreate the template from the intended site’s search results if necessary.
- The site searches for
%s: Confirm that you activated the saved shortcut, that the placeholder is exactly what your browser requires, and that it replaced the sample query in the correct field. A site or browser may also treat an unsupported placeholder as ordinary text. - Only part of the phrase arrives: Test the ampersand example. If text after
&is missing or becomes a separate parameter, the query may not have been encoded correctly. Check the browser’s substitution behavior and the site’s expected URL format. - Non-Latin text is garbled: Try a normal search directly on the site, then compare it with a shortcut search. The problem may be in the template, browser substitution, or the site’s handling of encoded text.
- The template contains a stale sample word: Replace the sample query itself, not an unrelated portion of the URL. Avoid changing the host or path while editing.
Best Practices
- Choose a shortcut that is easy to remember and doesn’t conflict with another saved search.
- Use a search provider you trust: your search terms are sent to that site, and may be subject to its privacy practices.
- Test with harmless phrases before using the shortcut routinely. Avoid putting sensitive information into searches unless you are comfortable sending it to the provider.
- Keep the template simple, but retain parameters the site needs to interpret the search correctly.
Conclusion
Build a template from a working search URL, replace the query with your browser’s supported placeholder, and verify the result with spaces, an ampersand, and non-Latin text. If the shortcut fails, check the destination, placeholder, and encoding before changing browsers or search providers.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.