{"id":177,"date":"2017-09-04T14:11:37","date_gmt":"2017-09-04T17:11:37","guid":{"rendered":"http:\/\/blog.hostdime.com.ar\/?p=177"},"modified":"2026-04-27T10:11:55","modified_gmt":"2026-04-27T13:11:55","slug":"cosas-que-debes-saber-sobre-el-archivo-robots-txt","status":"publish","type":"post","link":"https:\/\/www.hostdime.com.ar\/blog\/cosas-que-debes-saber-sobre-el-archivo-robots-txt\/","title":{"rendered":"Cosas que debes saber sobre el archivo robots.txt"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Un simple archivo de texto plano puede ser determinante para que tu sitio web aparezca o no en los resultados de Google.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Como sabemos, el archivo <strong>robots.txt<\/strong>, tiene la finalidad de <strong>bloquear el acceso de los robots<\/strong> a determinadas secciones de tu web, o a todo el sitio completo.<\/span><!--more--><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Aunque parezca que su funci\u00f3n tiene relaci\u00f3n directa con la privacidad, en realidad puede ser un arma de doble filo: Por un lado <strong>es eficaz para ocultar informaci\u00f3n a los buscadores<\/strong>, y por el otro; al ser un archivo p\u00fablico, cualquier persona leyendo su contenido puede saber <strong>cuales secciones de tu sitio contienen la informaci\u00f3n que deseas ocultar.<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A pesar de su simpleza tiene algunos secretos en su sintaxis que muchos webmaster suelen desconocer. Comencemos explicando la funci\u00f3n de las l\u00edneas que bloquean el rastreo de todos los robots a un sitio <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: *<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>Disallow: \/<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">La l\u00ednea &nbsp;<\/span><strong>User-agent:<\/strong><b> *<\/b><span style=\"font-weight: 400;\">, indica cual robot se debe controlar y el asterisco (*), significa que esta directiva se aplica a todos los robots. <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">La instrucci\u00f3n <\/span><strong>Disallow: \/<\/strong> <span style=\"font-weight: 400;\">le indica al robot que no debe visitar ninguna p\u00e1gina en el sitio.&nbsp;<\/span><span style=\"font-weight: 400;\">Por el contrario, puede bloquear solo una secci\u00f3n en particular, ej: <\/span><strong>Disallow: \/seccion <\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\u00bfComo es la sintaxis para permitir a todos los robots rastrear un sitio web?<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: *<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>Disallow: <\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A simple vista parece ser igual a la anterior, pero la diferencia est\u00e1 en el slash o barra inclinada ( \/ ) <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Esta es determinante para indicar que todo lo que est\u00e1 detr\u00e1s de ella no debe ser indexado, su ausencia indica exactamente lo contrario. Un modo similar de lograr el mismo cometido es con la siguiente sintaxis:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: *<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>Allow: \/<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">En verdad parece innecesario, porque de nada sirve indicar a un robot que haga lo que est\u00e1 programado para hacer, ya que lo har\u00e1 sin necesidad que se lo ordenes.&nbsp;<\/span><span style=\"font-weight: 400;\">Pero la presencia de esta directiva tiene una utilidad secundaria que veremos m\u00e1s adelante.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f27a4d3490a\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f27a4d3490a\"  aria-label=\"Alternar\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.hostdime.com.ar\/blog\/cosas-que-debes-saber-sobre-el-archivo-robots-txt\/#%C2%BFPuedo_bloquear_solo_los_robots_malignos\" >\u00bfPuedo bloquear s\u00f3lo los robots malignos?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.hostdime.com.ar\/blog\/cosas-que-debes-saber-sobre-el-archivo-robots-txt\/#%C2%BFPuedo_autorizar_un_solo_robot_y_bloquear_a_los_demas\" >\u00bfPuedo autorizar un solo robot y bloquear a los demas?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.hostdime.com.ar\/blog\/cosas-que-debes-saber-sobre-el-archivo-robots-txt\/#%C2%BFQue_pasa_si_no_tengo_robottxt\" >\u00bfQu\u00e9 pasa si no tengo robot.txt?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.hostdime.com.ar\/blog\/cosas-que-debes-saber-sobre-el-archivo-robots-txt\/#%C2%BFComo_se_explica_esta_contradiccion\" >\u00bfC\u00f3mo se explica esta contradicci\u00f3n?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"%C2%BFPuedo_bloquear_solo_los_robots_malignos\"><\/span><span style=\"color: #ff6600;\"><b>\u00bfPuedo bloquear s\u00f3lo los robots malignos?<\/b><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">En teor\u00eda s\u00ed, en la pr\u00e1ctica, no. Si el robot malo respeta las restricciones del \/robots.txt, y sabes el nombre de dicho robot, puedes a\u00f1adir una directiva para excluirlo espec\u00edficamente. <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: robot-malware<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>Disallow: \/<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Sin embargo, ning\u00fan robot malware respeta robots.txt, por lo que no tiene sentido tal directiva.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Si el robot malware opera desde una \u00fanica direcci\u00f3n IP, puedes bloquear su acceso a trav\u00e9s de la configuraci\u00f3n del servidor o con el archivo .htaccess.&nbsp;<\/span><span style=\"font-weight: 400;\">Pero es poco probable que un robot da\u00f1ino tenga una sola IP, generalmente operan desde una gran cantidad de direcciones IP diferentes, tales como PCs secuestradas en forma de<\/span> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Botnet\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">red de bots<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-197 size-full\" src=\"https:\/\/www.hostdime.com.ar\/blog\/wp-content\/uploads\/2017\/09\/Robots.txt-HostDime-Ar.png\" alt=\"Robots.txt HostDime Ar\" width=\"456\" height=\"224\"><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"%C2%BFPuedo_autorizar_un_solo_robot_y_bloquear_a_los_demas\"><\/span><span style=\"color: #ff6600;\"><b>\u00bfPuedo autorizar un solo robot y bloquear a los demas?<\/b><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Si, es posible hacerlo con varias directivas anidadas, por ejemplo; supongamos que deseas que solo Google rastree tu sitio:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: *<br \/>\nDisallow: \/<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: 18pt;\"><strong>User-agent: Googlebot<br \/>\nAllow: \/<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Aqu\u00ed es donde tiene utilidad aplicable la directiva <strong>Allow<\/strong>:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">La primera est\u00e1 bloqueando todos los robots, mientras que la segunda hace una excepci\u00f3n y s\u00f3lo habilita a Googlebot.&nbsp;<\/span><span style=\"font-weight: 400;\">En este caso el orden de los criterios es decisivo, ya que si ambas directivas estuvieran invertidas, el \u00faltimo criterio es el que prevalece.&nbsp;<\/span><span style=\"font-weight: 400;\">Esta condici\u00f3n suele confundir a los webmasters cuando <strong>Search console<\/strong> encuentra recursos bloqueados, un ejemplo muy com\u00fan es el siguiente:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Por seguridad WordPress bloquea al acceso al directorio \/wp-admin\/ de este modo<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #339966;\"><code><span style=\"font-weight: 400;\">User-Agent: *<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Disallow: \/wp-admin\/<\/span><\/code><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Pero hay recursos JavaScript necesarios para Google dentro de ese directorio, entonces a\u00f1adimos la l\u00ednea que permite acceder a ellos:<\/span><\/p>\n<div>\n<p><span style=\"color: #339966;\"><code><span style=\"font-weight: 400;\">User-Agent: *<\/span><\/code><\/span><\/p>\n<p><span style=\"color: #339966;\"><code><span style=\"font-weight: 400;\">Allow: \/wp-admin\/*.js<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Disallow: \/wp-admin\/<\/span><\/code><\/span><\/p>\n<\/div>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Sin embargo <\/span><strong>Search console<\/strong><span style=\"font-weight: 400;\"> sigue indicando que existe bloqueo.., \u00bfque est\u00e1 mal? <\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Precisamente el orden de la directiva. Si invertimos las l\u00edneas y verificamos el funcionamiento en el <\/span><strong>Probador de robots de Search console<\/strong><span style=\"font-weight: 400;\">, nos indicar\u00e1 que ahora est\u00e1 correcto:<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-187 size-full\" src=\"https:\/\/www.hostdime.com.ar\/blog\/wp-content\/uploads\/2017\/09\/Robots.txt-HostDime.png\" alt=\"Robots.txt HostDime\" width=\"338\" height=\"121\"><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"%C2%BFQue_pasa_si_no_tengo_robottxt\"><\/span><span style=\"color: #ff6600;\"><b>\u00bfQu\u00e9 pasa si no tengo robot.txt?<\/b><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">No pasa nada, al tener un car\u00e1cter restrictivo el hecho que falte el archivo, no afecta el rastreo normal del sitio. Sin embargo Google Indica que s\u00ed googlebot no detecta la presencia del archivo robots.txt, puede detener el rastreo del sitio.<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"%C2%BFComo_se_explica_esta_contradiccion\"><\/span><span style=\"color: #ff6600;\"><b>\u00bfC\u00f3mo se explica esta contradicci\u00f3n?<\/b><\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Si alguna vez has incluido el archivo en tu web, y por alguna raz\u00f3n, lo has quitado, aparecer\u00e1 una advertencia en Search console sobre la ausencia de robots.txt.<\/span><\/p>\n<blockquote><p><i><span style=\"font-weight: 400;\">Durante las \u00faltimas 24 horas, el robot de Google ha encontrado x errores al intentar acceder a robots.txt. Para asegurarnos de que no hemos rastreado ninguna p\u00e1gina que aparezca en ese archivo, hemos pospuesto el rastreo\u2026<\/span><\/i><\/p><\/blockquote>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Pero si tu web nunca ha incluido ese archivo, Googlebot jam\u00e1s ha intentado encontrarlo, por lo que seguir\u00e1 rastreando todas las p\u00e1ginas sin mayores problemas.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #ff6600;\">&nbsp;Ver tambi\u00e9n: <\/span><a href=\"https:\/\/www.hostdime.com.ar\/blog\/que-hacer-cuando-tu-sitio-web-esta-infectado\/\" target=\"_blank\" rel=\"noopener\">\u00bfQue hacer cuando tu sitio web est\u00e1 infectado?<\/a>, <a href=\"https:\/\/www.hostdime.com.ar\/blog\/prueba-nivel-servidor-vps-de-open-litespeed-mediciones-de-velocidad\/\" target=\"_blank\" rel=\"noopener\">Prueba a nivel servidor Vps de Open litespeed, mediciones de velocidad<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un simple archivo de texto plano puede ser determinante para que tu sitio web aparezca o no en los resultados de Google. Como sabemos, el archivo robots.txt, tiene la finalidad de bloquear el acceso de los robots a determinadas secciones [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":196,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10,11],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-marketing","category-posicionamiento-web","category-seo"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.hostdime.com.ar\/blog\/wp-content\/uploads\/2017\/09\/Cosas-que-debes-saber-sobre-el-archivo-robots.txt-min.png","_links":{"self":[{"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":1,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions\/1562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/media\/196"}],"wp:attachment":[{"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostdime.com.ar\/blog\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}