Recientemente, uno de nuestros lectores nos preguntó cómo optimizar el archivo robots.txt para mejorar el SEO.
El archivo robots.txt indica a los motores de búsqueda cómo rastrear su sitio web, lo que lo convierte en una herramienta SEO increíblemente potente.
En este artículo, le mostraremos algunos consejos sobre cómo crear un archivo robots.txt perfecto para SEO.
![Using WordPress robots.txt file to improve SEO Optimizing robots.txt file for better SEO](https://www.wpbeginner.com/wp-content/uploads/2021/03/optimize-robotsfile-seo-og.png)
¿Qué es un archivo Robots.txt?
Robots.txt es un archivo de texto que los propietarios de sitios web pueden crear para indicar a los robots de los motores de búsqueda cómo rastrear e indexar las páginas de sus sitios.
Normalmente se almacena en el directorio raíz (también conocido como la carpeta principal) de su sitio web. El formato básico de un archivo robots.txt es el siguiente:
User-agent: [user-agent name]
Disallow: [URL string not to be crawled]
User-agent: [user-agent name]
Allow: [URL string to be crawled]
Sitemap: [URL of your XML Sitemap]
Puede tener varias líneas de instrucciones para permitir o desautorizar URL específicas y añadir varios mapas del sitio. Si no desautoriza una URL, los robots de los motores de búsqueda supondrán que tienen permiso para rastrearla.
Este es el aspecto que puede tener un archivo robots.txt de ejemplo:
User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-admin/
Sitemap: https://example.com/sitemap_index.xml
En el ejemplo anterior de robots.txt, hemos permitido a los motores de búsqueda rastrear e indexar archivos en nuestra carpeta de subidas de WordPress.
A continuación, impedimos que los robots de búsqueda rastreen e indexen los plugins y las carpetas de administrador de WordPress.
Por último, hemos proporcionado la URL de nuestro mapa del sitio XML.
¿Necesita un archivo Robots.txt para su sitio WordPress?
Si no tiene un archivo robots.txt, los motores de búsqueda rastrearán e indexarán su sitio web. Sin embargo, no podrá indicarles qué páginas o carpetas no deben rastrear.
Esto no tendrá mucho impacto cuando empieces un blog y no tengas mucho contenido.
Sin embargo, a medida que su sitio web crezca y añada más contenido, es probable que desee controlar mejor cómo se rastrea e indexa su sitio web.
He aquí por qué.
Los robots de búsqueda tienen una cuota de rastreo para cada sitio web.
Esto significa que rastrean un determinado número de páginas durante una sesión de rastreo. Si agotan su presupuesto de rastreo antes de terminar de rastrear todas las páginas de su sitio, volverán y reanudarán el rastreo en la siguiente sesión.
Esto puede ralentizar la tasa / tarifa de indexación de su sitio web.
Puede corregirlo impidiendo que los robots de búsqueda rastreen páginas innecesarias, como las páginas de administrador de WordPress, los archivos de plugins y la carpeta de temas.
Al no permitir páginas innecesarias, usted guarda su cuota de rastreo. Esto ayuda a los motores de búsqueda a rastrear aún más páginas de su sitio e indexarlas lo más rápidamente posible.
Otra buena razón para utilizar un archivo robots.txt es impedir que los motores de búsqueda indexen una entrada o página de su sitio web.
Esta no es la forma más segura de ocultar contenido al público en general, pero le ayudará a evitar que el contenido aparezca en los resultados de búsqueda.
¿Cómo es un archivo Robots.txt ideal?
Muchos blogs populares utilizan un archivo robots.txt muy sencillo. Su contenido puede variar en función de las necesidades del sitio específico:
User-agent: *
Disallow:
Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml
Este archivo robots.txt permite a todos los robots indexar todo el contenido y les enlaza con los mapas del sitio web en formato XML.
Para sitios WordPress, recomendamos las siguientes reglas en el archivo robots.txt:
User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-admin/
Disallow: /readme.html
Disallow: /refer/
Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml
Indica a los robots de búsqueda que indexen todas las imágenes y archivos de WordPress. Impide que los robots de búsqueda indexen el área de administrador de WordPress, el archivo readme y los enlaces de afiliados ocultos.
Si añade mapas del sitio al archivo robots.txt, facilitará a los robots de Google la búsqueda de todas las páginas de su sitio.
Ahora que ya sabe cómo es un archivo robots.txt ideal, veamos cómo crear un archivo robots.txt en WordPress.
Cómo crear un archivo Robots.txt en WordPress
Existen dos formas de crear un archivo robots.txt en WordPress. Puede elegir el método que más le convenga.
Método 1: Editar el archivo Robots.txt con All in One SEO
All in One SEO, también conocido como AIOSEO, es el mejor plugin SEO para WordPress del mercado, utilizado por más de 3 millones de sitios web. Es fácil de usar y viene con un generador de archivos robots.txt.
Para obtener más información, consulte nuestra reseña detallada de AIOSEO.
Si aún no tiene instalado el plugin AIOSEO, puede consultar nuestra guía paso a paso sobre cómo instalar un plugin de WordPress.
Nota: También existe una versión gratuita de AIOSEO que incorpora esta característica.
Una vez instalado y activado el plugin, puede utilizarlo para crear y editar su archivo robots.txt directamente desde su área de administrador de WordPress.
Simplemente vaya a All in One SEO ” Herramientas para editar su archivo robots.txt.
![AIOSEO robots.txt editor Robots.txt file editor in All in One SEO](https://www.wpbeginner.com/wp-content/uploads/2021/03/robots-editor-aioseo.png)
En primer lugar, deberá activar la opción de edición haciendo clic en el conmutador “Activar Robots.txt personalizados” en azul.
Con este conmutador activado, puede crear un archivo robots.txt personalizado en WordPress.
![AIOSEO enable custom robots.txt Enable custom robots.txt file](https://www.wpbeginner.com/wp-content/uploads/2021/03/custom-robots-file.png)
All in One SEO mostrará su archivo robots.txt existente en la sección “Vista previa de Robots.txt” en la parte inferior de su pantalla.
Esta versión mostrará las reglas por defecto que fueron añadidas por WordPress.
![Robots.txt default rules Robots.txt file preview in All in One SEO](https://www.wpbeginner.com/wp-content/uploads/2021/11/robots-txt-preview-aioseo.png)
Estas reglas por defecto indican a los motores de búsqueda que no rastreen los archivos del núcleo de WordPress, permiten a los robots indexar todo el contenido y les proporcionan un enlace a los mapas del sitio XML de su sitio.
Ahora, puede añadir sus propias reglas personalizadas para mejorar su robots.txt para SEO.
Para añadir una regla, introduzca un agente de usuario en el campo “Agente de usuario”. Si utiliza *, la regla se aplicará a todos los agentes de usuario.
A continuación, seleccione si desea “Permitir” o “No permitir” que los motores de búsqueda rastreen.
A continuación, introduzca el nombre del archivo o la ruta del directorio en el campo “Ruta del directorio”.
![Add rule in robots.txt Add robots file rules](https://www.wpbeginner.com/wp-content/uploads/2021/03/add-robots-file-rules.png)
La regla se aplicará automáticamente a su robots.txt. Para añadir otra regla, basta con hacer clic en el botón “Añadir regla”.
Recomendamos añadir reglas hasta crear el formato ideal de robots.txt que compartimos anteriormente.
Sus reglas personalizadas tendrán este aspecto.
![Robots.txt custom rules file Custom robots txt file preview](https://www.wpbeginner.com/wp-content/uploads/2021/03/custom-robots-preview.png)
Cuando hayas terminado, no olvides hacer clic en el botón “Guardar cambios” para guardar los cambios.
Método 2: Editar el archivo Robots.txt usando WPCode
WPCode es un potente plugin de fragmentos de código que te permite añadir código personalizado a tu sitio web de forma fácil y segura.
También incluye una práctica característica que le permite editar rápidamente el archivo robots.txt.
Nota: También existe un plugin gratuito de WPCode, pero no incluye la característica de editor de archivos.
Lo primero que tienes que hacer es instalar el plugin WPCode. Para obtener instrucciones paso a paso, consulte nuestra guía para principiantes sobre cómo instalar un plugin de WordPress.
Una vez activado, tienes que ir a la página WPCode ” Editor de archivos. Una vez allí, simplemente haga clic en la pestaña ‘robots.txt’ para editar el archivo.
![WPCode robots.txt Editor WPCode robots.txt Editor](https://www.wpbeginner.com/wp-content/uploads/2021/03/wpcoderobotstxt2.png)
Ahora, puede pegar o escribir el contenido del archivo robots.txt.
Una vez que haya terminado, asegúrese de hacer clic en el botón “Guardar cambios” situado en la parte inferior de la página para establecer los ajustes.
Método 3: Edición manual del archivo Robots.txt mediante FTP
Para este método, necesitará utilizar un cliente FTP para editar el archivo robots.txt. También puede utilizar el gestor de archivos de su alojamiento de WordPress.
Simplemente conéctese a los archivos de su sitio web WordPress utilizando un cliente FTP.
Una vez dentro, podrá ver el archivo robots.txt en la carpeta raíz de su sitio web.
![FTP connection robots.txt Edit robots file via FTP](https://www.wpbeginner.com/wp-content/uploads/2021/03/edit-robots-ftp.png)
Si no ve ninguno, es probable que no tenga un archivo robots.txt.
En ese caso, puedes seguir adelante y crear uno.
![FTP connection create robots.txt Create new robots file](https://www.wpbeginner.com/wp-content/uploads/2021/03/create-new-robots-file.png)
Robots.txt es un archivo de texto plano, lo que significa que puede descargarlo a su ordenador y editarlo con cualquier editor de texto plano como Notepad o TextEdit.
Tras guardar los cambios, puede volver a subir el archivo robots.txt a la carpeta raíz de su sitio web.
Cómo probar su archivo Robots.txt
Una vez que haya creado su archivo robots.txt, siempre es una buena idea probarlo utilizando una herramienta de comprobación de robots.txt.
Existen muchas herramientas de comprobación de robots.txt, pero te recomendamos que utilices la que se encuentra en Google Search Console.
En primer lugar, tendrás que enlazar tu sitio web con Google Search Console. Si aún no lo ha hecho, consulte nuestra guía sobre cómo añadir su sitio de WordPress a Google Search Console.
A continuación, puede utilizar la herramienta de comprobación de robots de Google Search Console.
![Select website property robots.txt tester Choose property](https://www.wpbeginner.com/wp-content/uploads/2021/03/choose-property.png)
Sólo tiene que seleccionar su propiedad en la lista desplegable.
La herramienta buscará automáticamente el archivo robots.txt de su sitio web y resaltará los errores y advertencias si encuentra alguno.
![Robots.txt tester results Robots tester tool](https://www.wpbeginner.com/wp-content/uploads/2021/03/robots-tester.png)
Reflexiones finales
El objetivo de optimizar su archivo robots.txt es evitar que los motores de búsqueda rastreen páginas que no están disponibles públicamente. Por ejemplo, páginas en su carpeta wp-plugins o páginas en su carpeta de administrador de WordPress.
Un mito común entre los expertos en SEO es que el bloqueo de categorías, etiquetas y páginas de archivo de WordPress mejorará la tasa de rastreo y dará lugar a una indexación más rápida y mejores clasificaciones.
Esto no es cierto. También va en contra de las directrices para webmasters de Google.
Le recomendamos que siga el formato robots.txt anterior para crear un archivo robots.txt para su sitio web.
Guías de expertos sobre el uso de Robots.txt en WordPress
Ahora que ya sabe cómo optimizar su archivo robots.txt, puede que le interese ver otros artículos relacionados con el uso de robots.txt en WordPress.
- Glosario Robots.txt
- Cómo ocultar una página de WordPress de Google
- Cómo impedir que los motores de búsqueda rastreen un sitio WordPress
- Cómo eliminar permanentemente un sitio WordPress de Internet
- Cómo ocultar (no indexar) fácilmente archivos PDF en WordPress
- Cómo solucionar el error “Googlebot no puede acceder a los archivos CSS y JS” en WordPress
- Cómo configurar correctamente All in One SEO para WordPress (Guía definitiva)
Esperamos que este artículo le haya ayudado a aprender a optimizar su archivo robots.txt de WordPress para SEO. Puede que también quieras ver nuestra guía definitiva de SEO para WordPress y nuestra selección de las mejores herramientas SEO para WordPress para hacer crecer tu sitio web.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Steve says
Thanks for this – how does it work on a WP Multisite thou?
WPBeginner Support says
For a multisite, you would need to have a robots.txt file in the root folder of each site.
Administrador
Pacifique Ndanyuzwe says
My wordpress site is new and my robot.txt by default is
user-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
I want google to crawl and index my content. Is that robot.txt okay?
WPBeginner Support says
You can certainly use that if you wanted
Administrador
Ritesh Seth says
Great Airticle…
I was confused from so many days about Robots.txt file and Disallow links. Have copied the tags for robots file. Hope this will solve the issue of my Site
WPBeginner Support says
We hope our article will help as well![:)](https://www.wpbeginner.com/es/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Kurt says
The files in the screenshots of your home folder are actually located under the public_html folder under my home folder.
I did not have a /refer folder under my public_html folder.
I did not have post or page xml files anywhere on my WP account.
I did include an entry in the robots.txt file I created to disallow crawling my sandbox site. I’m not sure that’s necessary since I’ve already selected the option in WP telling crawlers not to crawl my sandbox site, but I don’t think it will hurt to have the entry.
WPBeginner Support says
Some hosts do rename public_html to home which is why you see it there. You would want to ensure Yoast is active for the XML files to be available. The method in this article is an additional precaution to help with preventing crawling your site![:)](https://www.wpbeginner.com/es/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Ahmed says
Great article
WPBeginner Support says
Thank you![:)](https://www.wpbeginner.com/es/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
ASHOK KUMAR JADON says
Hello, such a nice article you solve my problem. So Thank You so much
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/es/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Elyn Ashton says
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php <– This is my robot.txt code but im confuse why my /wp-admin is index? How to no index it?
WPBeginner Support says
If it was indexed previously you may need to give time for the search engine’s cache to clear
Administrador
Ashish kumar says
This website really inspire me to start a blog .Thank you lost of tema.this website each and every article have rich of information and explanation.when i have some problem at first i visit this blog . Thank You
WPBeginner Support says
Glad our articles can be helpful![:)](https://www.wpbeginner.com/es/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Anna says
I am trying to optimise robots for my website using Yoast. However Tools in Yoast does not have the option for ‘File Editor’.
There are just two options
(i) Import and Export
(ii) Bulk editor
May you please advise how this can be addressed. Could it be that I am on a free edition of Yoast?
WPBeginner Support says
The free version of Yoast still has the option, your installation may be disallowing file editing in which case you would likely need to use the FTP method.
Administrador
Emmanuel Husseni says
I really find this article helpful because I really don’t know much on how robot.txt works but now I do.
pls what I don’t understand is how do I find the best format of robot.txt to use on my site (I mean one that works generally)?
I noticed lots of big blogs I check ranking high on search engine uses different robot.txt format..
I’ll be clad to see a reply from you or just anyone that can help
Editorial Staff says
Having a sitemap and allowing the areas that need to be allowed is the most important part. The disallow part will vary based on each site. We shared a sample in our blog post, and that should be good for most WordPress sites.
Administrador
WPBeginner Support says
Hey Emmanuel,
Please see the section regarding the ideal robots.txt file. It depends on your own requirements. Most bloggers exclude WordPress admin and plugin folders from the crawl.
Administrador
Emmanuel Husseni says
Thank you so much.
now I understand. I guess I’ll start with the general format for now.
jack says
Well written article, I recommend the users to do sitemap before creating and enabling their ROBOTS text it will help your site to crawl faster and indexed easily.
Jack
Connie S Owens says
I would like to stop the search engines from indexing my archives during their crawl.
Emmanuel Nonye says
Thanks alot this article it was really helpful
Cherisa says
I keep getting the error message below on google webmaster. I am basically stuck. A few things that were not clear to me on this tutorial is where do I find my site’s root files, how do you determine if you already have a “robots.txt” and how do you edit it?
WPBeginner Support says
Hi Cherisa,
Your site’s root folder is the one that contains folders like wp-admin, wp-includes, wp-content, etc. It also contains files like wp-config.php, wp-cron.php, wp-blogheader.php, etc.
If you cannot see a robots.txt file in this folder, then you don’t have one. You can go a head and create a new one.
Administrador
Cherisa says
Thank you for your response. I have looked everywhere and can’t seem to locate these root files as you describe. Is there a path directory I can take that leads to this folder. Like it is under Settings, etc?
Devender says
I had a decent web traffic to my website. Suddenly dropped to zero in the month of May. Till now I have been facing the issue. Please help me to recover my website.
Haris Aslam says
Hello There Thank you For This Information, But I Have A Question
That I Just Create The Sitemap.xml and Robots.txt File, & Its Crawling well. But How Can I Create “Product-Sitemap.xml”
There is all list of product in sitemap.xml file. Do I Have To Create Product-sitemap.xml separately?
and submit to google or bing again ?
Can You please Help me out…
Thank You
Mahadi Hassan says
I have a problem on robots.txt file setting. Only one robots.txt is showing for all websites. Please help me to show separate robots.txt file of all websites. I have all separate robots.txt file of all individual website. But only one robots.txt file is showing in browser for all websites.
Debu Majumdar says
Please explain why did you include
Disallow: /refer/
in the beginner Robots.txt example? I do not understand the implications of this line. Is this important for the beginner? You have explained the other two Disallowed ones.
Thanks.
WPBeginner Support says
Hi Debu,
This example was from WPBeginner’s robots.txt file. At WPBeginner we use ThirstyAffiliates to manage affiliate links and cloak URLs. Those URLs have /refer/ in them, that’s why we block them in our robots.txt file.
Administrador
Evaristo says
How can I put all tags/mydomain.Com in nofollow? In robots.txt to concentrate the link Juice? Thanks.
harsh kumar says
hey,,i am getting error in yoast seo regarding site map..once i click on fix it ,,,it’s coming again..my site html is not loading properly
Tom says
I’ve just been reviewing my Google Webmaster Tools account and using the Search Console, I’ve found the following:
Page partially loaded
Not all page resources could be loaded. This can affect how Google sees and understands your page. Fix availability problems for any resources that can affect how Google understands your page.
This is because all CSS stylesheets associated with Plugins are disallowed by the default robots.txt.
I understand good reasons why I shouldn’t just make this allowable, but what would be an alternative as I would suspect the Google algorithms are marking down the site for not seeing these.
Suren says
Hi,
Whenever, I search my site on the google this text appears below the link: “A description for this result is not available because of this site’s robots.txt”
How, can i solve this issue?
Regards
WPBeginner Support says
Hi Suren,
Seems like someone accidentally changed your site’s privacy settings. Go to Settings » Reading page and scroll down to ‘Search engine visibility’ section. Make sure that the box next to is unchecked.
Administrador
Divyesh says
Hello
As i seen in webmaster tool, i got robot.txt file like below :
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
let me know is that okey ? or should i use any other ?
John Cester says
I want to know, does it a good idea to block (disallow) “/wp-content/plugins/” in robots.tx? Every time i remove a plugin it shows 404 error in some pages of that plugin.
Himanshu singh says
I loved this explanation. As a beginner I was very confused about robot.txt file and its uses. But now I know what is its purpose.
rahul says
in some robot.txt file index.php has been disallowed. Can you explain why ? is it a good practice.
Waleed Barakat says
Thanks for passing by this precious info.
Awais Ahmed says
Can you please tell me why this happening on webmaster tool:
Network unreachable: robots.txt unreachableWe were unable to crawl your Sitemap because we found a robots.txt file at the root of your site but were unable to download it. Please ensure that it is accessible or remove it completely.
robots.txt file exist but still
Dozza says
Interesting update from the Yoast team on this at
Quote: “The old best practices of having a robots.txt that blocks access to your wp-includes directory and your plugins directory are no longer valid.”
natveimaging says
Allow: /wp-content/uploads/
Shouldn’t this be?
Disallow: /wp-content/uploads/
Because you are aware that google will index all your uploads pages as public URLs right? And then you will get slapped with errors for the page itself. Is there something I am missing here?
nativeimaging says
Overall, its the actual pages that google crawls to generate image maps, NOT the uploads folders. Then you would have a problem of all the smaller image sizes, and other images that are for UI will also get indexed.
This seems to be the best option:
Disallow: /wp-content/uploads/
If i’m incorrect, please explain this to me so I can understand your angle here.
Jason says
My blog url not indexing do i need to change my robots.txt?
Im using this robots.txt
iyan says
how to create robot txt which is ONLY allow index for page and Post.. thanks
Simaran Singh says
I am not sure what’s the problem but my robots.txt has two versions.
One at http://www.example.com/robots.txt and second at example.com/robots.txt
Anybody, please help! Let me know what can be the possible cause and how to correct it?
WPBeginner Support says
Most likely, your web host allows your site to be accessed with both www and non-www urls. Try changing robots.txt using an FTP client. Then examine it from both URLs if you can see your changes on both URLs then this means its the same file.
Administrador
Simaran Singh says
Thanks for the quick reply. I have already done that, but I am not able to see any change. Is there any other way to resolve it?
Martin conde says
Yoasts blogpost about this topic was right above yours in my search so of course I checked them both. They are contradicting each other a little bit.. For example yoast said that disallowing plugin directories and others, might hinder the Google crawlers when fetching your site since plugins may output css or js. Also mentioned (and from my own experience), yoast doesn’t add anything sitemap related to the robots.txt, rather generates it so that you can add it to your search console. Here is the link to his post, maybe you can re-check because it is very hard to choose whose word to take for it
MM Nauman says
As I’m Not Good in Creating this Robotstxt file So Can I use your Robots.txt file by changing the parameters like url and sitemap of my site is it good? or should I create a different one
Mohit Chauhan says
Hi,
Today i got this mail from Google “Googlebot cannot access CSS and JS files”…what can be the solution?
Thanks
Parmod says
Let me guess… You are using CDN services to import CSS and JS files.
or
It may be possible that you have written wrong syntax in these file.
Rahul says
I have a question about adding Sitemaps. How can I add Yahoo and Bing Sitemap to Robots file and WordPress Directory?
Gerbrand Petersen says
Thanks for the elaborate outline of using the robots file. Does anyone know if Yahoo is using this robots.txt too, and does it obey the rules mentioned in the file? I ask this since I have a “Disallow” for a certain page in my file, but I do receive traffic coming from Yahoo on that page. Nothing from Google, as it should be. Thanks in advance.
Erwin says
correction…
“If you are using Yoast’s WordPress SEO plugin or some other plugin to generate your XML sitemap, then your plugin will try to automatically add your sitemap related lines into robots.txt file.”
Not true. WordPress SEO doesn’t add the sitemap to the robots.txt
“I’ve always felt linking to your XML sitemap from your robots.txt is a bit nonsense. You should be adding them manually to your Google and Bing Webmaster Tools and make sure you look at their feedback about your XML sitemap. This is the reason our WordPress SEO plugin doesn’t add it to your robots.txt.”
https://yoast.com/wordpress-robots-txt-example/
Also more recommended is not to disallow the wp-plugins directory (reasons see Yoast’s post)
And personally I like to simply remover the readme.txt file…
hyma says
I understood it robots.txt file and use of robots file. What is the site map how do I create sitemap for my site.
Rick R. Duncan says
After reading Google’s documentation I’m under the impression that the directive to use in the robots.txt file is disallow which only tells the bots what they can and cannot crawl. It does not tell them what can and cannot be indexed. You need to use the noindex robots meta tag to have a page noindexed.
Nitin says
really good article for seo optimized robots.txt file. But I need you to give a tutorial on how to upload robots.txt file to server. As, being a beginner it seems to be a drastic problem to upload that file.
By the way thanks to share such beneficial information.
-Nitin
Parmod says
Upload it to your server/public_hmtl/(Your-site-name) … in this folder
Jenny says
What is the best way to add code to HTTacess to block multiple spam bot refers for their url and Ip address if no URL is given
I know if you get wrong syntax when doing httacess it can take your site off line I am a newbie and need to block these annoying multiple urls from Russia, China, Ukraine etc.
Many thanks
Hazel Andrews says
Thanks for those tips….robot txt files now amended! yay!
Rahat says
why have to add Allow: !!!
if I mention only which have to Disallow that enough. Don’t have to write code for Allow because Googlebot or Bingbot will crawl all other thing automatically.
So why should I use Allow again?
Connor Rickett says
Since lacking the Robots.txt file doesn’t stop the site from being crawled, I find myself curious: Is there any sort of hard data on exactly how much having the file will improve SEO performance?
I did a quick Google search, and didn’t see any sort of quantitative data on it. It’s about half a million articles saying, “Hey, this makes SEO better!” but I’d really like to know what we’re talking about here, even generally.
Is this a 5% boost? 50? 500?
WPBeginner Support says
Search engines don’t share such data. While not having a robots.txt file does not stop search engines from crawling or indexing a website. However, it is a recommended best practice.
Administrador
Connor Rickett says
Thanks for taking the time to get back to me, I appreciate it!
JD Myers says
Good timing on this. I was trying to find this information just yesterday.
The reason I was searching for it is that Google Webmaster tools was telling me that they could not properly crawl my site because I was blocking various resources needed for the proper rendering of the page.
These resources included those found in /wp-content/plugins/
After I allowed this folder, the warning disappeared.
Any thoughts on this?
WPBeginner Support says
You can safely ignore those warnings. It is only a warning if you actually had content there that you would want to get indexed. Sometimes users have restricted search bots and have forgotten about it. These warnings come in handy in those situations.
Administrador
Chetan jadhav says
I have a question that many people out there use static sitemap, and you know what they have wordpress site. Should we us static or sitemap genrated by worpress.
Wilton Calderon says
NIce, i like the way Wpbeginner have, and with that rank in alexa, look to me is one of the best way to sue robots.txt..
Brigitte Burke says
what does my robots.txt file mean if it looks like this?
User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Editorial Staff says
It’s just saying that search engines should not index your wp-admin folder, wp-includes folder, and the xml-rpc file. Sometimes disallowing /wp-includes/ can block certain scripts for search engines specially if your site is using those scripts. This can hurt your SEO.
The best thing to do is go to Google Webmaster Tools and fetch your website as a bot there. If everything loads fine, then you have nothing to worry about. If it says that scripts are blocked, then you may want to take out the wp-includes line.
Administrador
hercules says
I see no logic in your idea about having a script within the includes directory that can be used by a crawn / robot .. and another, if there is an isolated case, it is better after specify the default wordpress allow this file you imagine that search engines use his scripts! after all, wordpress has certainly not by default an robots.txt anti serch engines!!!!