Change or Translate the Ghost Search Text
Change the “Search posts, tags and authors” placeholder in Ghost's built-in search — translate it or reword it with one code injection snippet.
Ghost’s built-in search (the Sodo search modal) ships with hard-coded English strings — the input placeholder says “Search posts, tags and authors” no matter what language your site is in, and there’s no admin setting to change it. Because the search modal is part of Ghost itself, not your theme, translating your theme doesn’t touch it.
This snippet rewrites the placeholder to any text you want, in any language. It works on every Ghost theme that uses Ghost’s native search.
The Code
Paste into Settings → Code injection → Site footer, and change the TEXT value to your wording:
<script>(function() { var TEXT = 'Pretraži članke, oznake i autore'; // your placeholder text
function patch(doc) { var input = doc.querySelector('input'); if (input) input.placeholder = TEXT; }
function watch() { var root = document.getElementById('sodo-search-root'); if (!root) return; var frame = root.querySelector('iframe'); if (frame && frame.contentDocument) { patch(frame.contentDocument); new MutationObserver(function() { patch(frame.contentDocument); }).observe(frame.contentDocument.body, { childList: true, subtree: true }); } else { setTimeout(watch, 300); } }
new MutationObserver(watch).observe(document.body, { childList: true }); watch();})();</script>How to Install
- Ghost Admin → Settings → Code injection
- Paste into Site footer, edit the
TEXTline, save - Open your site and hit the search icon — the placeholder shows your text
How It Works
Ghost renders search inside an iframe under #sodo-search-root. Because that iframe is created by your own site (not loaded from another domain), your scripts are allowed to reach inside it. The snippet waits for the iframe to exist, sets the placeholder, and keeps a MutationObserver running so the text is re-applied every time the search UI re-renders — Sodo rebuilds its interface when the modal opens, which is why simpler one-shot snippets appear to work and then revert.
Customization
Other strings inside the search modal (like the “Recent searches” heading) can be rewritten the same way — find the element inside frame.contentDocument and set its textContent in the patch() function.
Works With
Every Ghost theme using Ghost’s native search. Themes with their own custom search UI (not the Sodo modal) translate through the theme instead — every Luxe theme with custom search ships translation files, so on Luxe themes the search UI follows your site language without code. See the theme translation guide for your theme.