The robots.txt Mistake That's Hiding Your Pages From Google

If you have ever opened your Google Search Console and seen the warning "Indexed, though blocked by robots.txt", you have run into one of the most misunderstood quirks of how Google handles a website. The message sounds contradictory — how can a page be both indexed and blocked? — and most site owners assume it is a bug or a temporary glitch. It is neither. It is the predictable result of using the wrong tool for the wrong job, and the fix is simpler than the warning suggests.

This is a problem we see on almost every legacy website we audit, particularly on sites that were built or maintained by someone who learned SEO from a checklist rather than from how Google actually works. The good news is that once you understand the distinction Google makes between two very different concepts, the fix takes about thirty seconds.

Crawling and Indexing Are Not the Same Thing

The single most common misconception about SEO is treating crawling and indexing as one process. They are two completely separate steps, and they are controlled by completely separate mechanisms.

Crawling is the act of Google's robot fetching the contents of a page so it can read what is on it. Indexing is the act of Google adding a page to its searchable database, where it can appear in search results.

The reason this matters is that you can have one without the other. A page can be indexed without ever being crawled, if Google has discovered it through links from other sites but cannot read its contents. That is exactly what produces the warning we are talking about.

What robots.txt Actually Does

The robots.txt file at the root of your site is a polite request that tells search engine crawlers which paths they are allowed to fetch. A typical line looks like this:

Disallow: /private-page.html

That instruction blocks crawling. It does not block indexing. If Google finds a link to that page somewhere on the web — from your own footer, from a competitor's site, from a directory listing — it will add the URL to its index even though it cannot actually read what is on the page. The result is an indexed URL with no content, no description, and no useful snippet for users.

When that happens, Google sends you the warning. It is telling you that you have a page in its search results that it does not understand, and it is asking whether that is what you intended.

The Trap Most People Fall Into

The reason this mistake is so common is that the official-sounding name "robots.txt" suggests it controls what robots do with your pages in general. People assume that disallowing a path keeps that page out of Google entirely. So when they want to hide a thank-you page, a draft article, or a private document, they add a Disallow line and move on.

What actually happens is that the page stays out of the crawl queue but slips into the index through the back door. Users searching for your brand will see the page listed in results, with a generic "No information is available for this page" snippet underneath it. To anyone scanning the search results, this looks suspicious — as if you are hiding something. It also wastes a slot on the search results page that could have shown a more useful URL from your site.

The Right Tool for Each Job

The fix depends on what you actually want to happen. Two different goals require two different tools.

If you want the page to appear normally in Google with proper content, do nothing special. Let Google crawl and index it. Remove any Disallow line that targets it. Most pages on most websites fall into this category — including legal pages like privacy policies and cookie notices that many owners reflexively try to hide. Those pages are fine to index. They take nothing away from your SEO and they signal to Google that you run a legitimate business.

If you want the page completely out of Google's search results, you need to do the opposite of what robots.txt does. You need to let Google crawl the page, then add a tag inside the page that tells Google not to index it. The tag goes inside the <head> section:

<meta name="robots" content="noindex,follow" />

That single line is far more effective than any robots.txt rule. Google crawls the page, reads the tag, and removes the URL from its index. The "follow" part tells Google it can still follow the links inside the page, which preserves the flow of authority through your site.

A Quick Real-World Example

Imagine you have a private internal staging page at /staging-preview.html that you do not want appearing in search. Most site owners would write this in robots.txt:

User-agent: *
Disallow: /staging-preview.html

This is the trap. If anyone links to the staging page from anywhere — even accidentally, even from a forgotten internal document — Google will index the URL without content. The proper approach has two parts. First, in robots.txt, do not block it. Second, on the staging page itself, add the noindex tag in the head:

<meta name="robots" content="noindex,follow" />

Google will crawl the page, see the tag, and keep the URL out of the index entirely. No warning, no orphaned listing, no awkward snippet.

When robots.txt Is Actually Useful

This is not a piece against robots.txt. It remains a perfectly good tool for a specific job: telling crawlers to skip parts of your site that are not worth crawling at all. Large directories of duplicate URLs, faceted search results, admin paths, server-rendered preview tokens — these belong in robots.txt because there is nothing on those pages worth indexing in the first place. Saving the crawl budget for your real content is a legitimate use case.

What robots.txt is not is a privacy mechanism, an access control, or a way to keep pages out of search results. Anyone can read your robots.txt file directly, so listing private URLs there actually makes them easier to discover. And as we have just seen, blocking the path does not stop the URL from being indexed when it is linked from elsewhere.

How to Fix It on Your Own Site

If you are reading this because Search Console sent you the warning, the steps are quick:

If you are not sure whether your site has this problem, the fastest way to check is to open Search Console, go to the Pages report, and look for the "Indexed, though blocked by robots.txt" row. If it is there, those pages are the ones to start with.

The Bigger Lesson

Most SEO mistakes happen because the tools are named in a way that suggests they do something they do not. robots.txt sounds authoritative, but it only controls the politest part of crawling. Meta tags inside the page itself are what actually govern indexing. Sitemaps suggest pages to Google but do not guarantee anything. Canonical tags hint at preferred versions but Google still chooses. Every one of these tools has a specific, narrow job, and the trouble starts when they are pressed into service for something else.

The fix in every case is the same: figure out what behavior you actually want, then pick the tool that controls that specific behavior. With robots.txt and indexing, the right answer is almost always to leave robots.txt alone and use the noindex meta tag — or, more often than you might expect, to do nothing at all and let Google do its job.

Ako ste ikad otvorili Google Search Console i ugledali upozorenje "Indexed, though blocked by robots.txt", naletjeli ste na jednu od najpogrešnije shvaćenih situacija u načinu na koji Google obrađuje web stranicu. Poruka zvuči kontradiktorno — kako stranica može biti istovremeno indeksirana i blokirana? — i većina vlasnika sajta misli da je riječ o bagu ili privremenom problemu. Nije ni jedno ni drugo. To je predvidiv rezultat korištenja krivog alata za krivi posao, a popravak je jednostavniji nego što upozorenje sugerira.

Ovo je problem na koji nailazimo gotovo na svakoj starijoj web stranici koju revidiramo, posebno na onima koje je gradio ili održavao netko tko je SEO učio s checkliste, a ne razumijevanjem kako Google stvarno funkcionira. Dobra vijest je da kad jednom razumijete razliku koju Google pravi između dva potpuno različita pojma, ispravak traje oko trideset sekundi.

Crawling i indeksiranje nisu ista stvar

Najčešća zabluda u SEO-u je tretirati crawling i indeksiranje kao jedan proces. To su dva potpuno odvojena koraka i kontroliraju se potpuno različitim mehanizmima.

Crawling je čin u kojem Googleov robot dohvaća sadržaj stranice kako bi pročitao što je na njoj. Indeksiranje je čin u kojem Google dodaje stranicu u svoju pretraživu bazu, gdje se može pojaviti u rezultatima pretrage.

Zašto je to važno: možete imati jedno bez drugoga. Stranica može biti indeksirana, a da nikada nije bila crawlana, ako ju je Google otkrio putem linkova s drugih sajtova, ali ne može pročitati njezin sadržaj. Upravo to proizvodi spomenuto upozorenje.

Što robots.txt zapravo radi

Datoteka robots.txt u korijenu vašeg sajta uljudna je molba kojom govorite tražilicama koje putanje smiju dohvaćati. Tipičan red izgleda ovako:

Disallow: /privatna-stranica.html

Ta uputa blokira crawling. Ne blokira indeksiranje. Ako Google negdje na webu pronađe link na tu stranicu — iz vlastitog footera, s konkurentskog sajta, iz nekog imenika — dodat će URL u svoj indeks, iako zapravo ne može pročitati što je na stranici. Rezultat je indeksirani URL bez sadržaja, bez opisa i bez korisnog snippeta za korisnika.

Kad se to dogodi, Google vam šalje upozorenje. Govori vam da imate stranicu u svojim rezultatima koju ne razumije i pita je li to ono što ste željeli.

Zamka u koju većina upadne

Razlog zašto je ova greška tako česta je što službeno zvučeće ime "robots.txt" sugerira da kontrolira što roboti rade s vašim stranicama općenito. Ljudi pretpostavljaju da zabranom putanje stranica u potpunosti ostaje izvan Googlea. Pa kad žele sakriti thank-you stranicu, draft članak ili privatan dokument, dodaju Disallow redak i nastave dalje.

Zapravo se događa to da stranica ostane izvan reda za crawlanje, ali se kroz stražnja vrata uvuče u indeks. Korisnici koji pretražuju vaš brand vidjet će stranicu u rezultatima, s generičkim "No information is available for this page" tekstom ispod nje. Svakome tko prelazi pogledom kroz rezultate to izgleda sumnjivo — kao da nešto skrivate. Također troši mjesto u rezultatima koje je mogao zauzeti korisniji URL s vašeg sajta.

Pravi alat za svaki posao

Popravak ovisi o tome što stvarno želite. Dva različita cilja zahtijevaju dva različita alata.

Ako želite da se stranica normalno pojavljuje u Googleu s pravim sadržajem, nemojte raditi ništa posebno. Pustite Googleu da je crawla i indeksira. Uklonite eventualni Disallow redak koji je cilja. Većina stranica na većini sajtova spada u ovu kategoriju — uključujući legalne stranice poput politike privatnosti i obavijesti o kolačićima koje mnogi vlasnici refleksno pokušavaju sakriti. Te stranice su sasvim u redu za indeksiranje. Ne oduzimaju ništa vašem SEO-u i signaliziraju Googleu da poslujete legitimno.

Ako želite stranicu potpuno izvan Googleovih rezultata, trebate napraviti suprotno od onoga što robots.txt radi. Trebate pustiti Googleu da crawla stranicu, a zatim unutar stranice dodati tag koji govori Googleu da je ne indeksira. Tag ide u <head> sekciju:

<meta name="robots" content="noindex,follow" />

Taj jedan redak učinkovitiji je od bilo kojeg pravila u robots.txt. Google crawla stranicu, pročita tag i ukloni URL iz svog indeksa. Dio "follow" govori Googleu da i dalje smije pratiti linkove unutar stranice, što čuva tijek authoritya kroz sajt.

Kratki primjer iz prakse

Zamislite da imate privatnu internu staging stranicu na /staging-preview.html za koju ne želite da se pojavljuje u pretrazi. Većina vlasnika sajta napisala bi ovo u robots.txt:

User-agent: *
Disallow: /staging-preview.html

Ovo je zamka. Ako bilo tko poveže staging stranicu odbilo kojeg mjesta — čak i slučajno, čak i iz zaboravljenog internog dokumenta — Google će indeksirati URL bez sadržaja. Pravi pristup ima dva dijela. Prvo, u robots.txt je ne blokirajte. Drugo, na samoj staging stranici dodajte noindex tag u head:

<meta name="robots" content="noindex,follow" />

Google će crawlati stranicu, vidjeti tag i URL ostaviti u potpunosti izvan indeksa. Bez upozorenja, bez napuštenog zapisa, bez nezgodnog snippeta.

Kad je robots.txt zapravo koristan

Ovo nije tekst protiv robots.txt-a. On ostaje sasvim dobar alat za jedan konkretan posao: govori crawlerima da preskoče dijelove sajta koji uopće nisu vrijedni crawlanja. Veliki imenici duplikata URL-ova, faceted search rezultati, admin putanje, server-rendered preview tokeni — sve to pripada u robots.txt jer na tim stranicama ionako nema ničega što bi bilo vrijedno indeksirati. Štednja crawl budgeta za pravi sadržaj sasvim je legitimna primjena.

Ono što robots.txt nije je mehanizam za privatnost, kontrola pristupa ili način da se stranice drže izvan rezultata pretrage. Svatko može pročitati vašu robots.txt datoteku izravno, pa popisivanje privatnih URL-ova u njoj zapravo olakšava njihovo otkrivanje. I, kako smo upravo vidjeli, blokiranje putanje ne sprečava da URL bude indeksiran kad postoji link s drugog mjesta.

Kako to popraviti na vlastitom sajtu

Ako ovo čitate jer vam je Search Console poslao upozorenje, koraci su brzi:

Ako niste sigurni ima li vaš sajt ovaj problem, najbrži način provjere je otvoriti Search Console, otići na Pages izvještaj i potražiti redak "Indexed, though blocked by robots.txt". Ako je tu, te su stranice mjesto gdje treba početi.

Šira pouka

Većina SEO grešaka događa se zato što su alati imenovani na način koji sugerira da rade nešto što ne rade. robots.txt zvuči autoritativno, ali kontrolira samo najuljudniji dio crawlanja. Meta tagovi unutar same stranice su ono što stvarno upravlja indeksiranjem. Sitemape predlažu stranice Googleu, ali ništa ne garantiraju. Canonical tagovi sugeriraju preferiranu verziju, ali Google i dalje sam odlučuje. Svaki od ovih alata ima svoj specifičan, uzak posao, a problemi počinju kada ih se forsira da rade nešto drugo.

Popravak je u svakom slučaju isti: utvrdite koje ponašanje zapravo želite, a zatim odaberite alat koji upravo to kontrolira. S robots.txt-om i indeksiranjem, pravi odgovor gotovo uvijek je pustiti robots.txt na miru i koristiti noindex meta tag — ili, češće nego što biste očekivali, ne raditi ništa i pustiti Googleu da odradi svoj posao.

← Back to blog