{"id":71776,"date":"2023-07-13T20:49:01","date_gmt":"2023-07-13T20:49:01","guid":{"rendered":"https:\/\/mailrelay.com\/glossary\/robots-txt\/"},"modified":"2026-10-02T15:15:11","modified_gmt":"2026-10-02T15:15:11","slug":"robots-txt","status":"publish","type":"glossary","link":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/","title":{"rendered":"Robots.txt"},"content":{"rendered":"<p>The robots.txt file is a document that tells search engine indexing spiders which parts of a website can be indexed and provides a link to the XML-sitemap.<\/p>\n<p>Put more simply, a robots.txt file tells search engine crawlers which URLs of a site they can access, but it is in no way a mechanism that prevents the page from being indexed, since many crawlers ignore the robots.txt instructions.<\/p>\n<p>When crawlers or spiders ignore the indexing block placed on them in the robots.txt (which is none other than noindex), you will need to password-protect the website to prevent them from indexing it.<\/p>\n<h2>1. What is the robots.txt file used for?<\/h2>\n<p>In general, the robots.txt file is used to give specific instructions to the crawlers of the different search engines. Let&#8217;s look at some more specific functions.<\/p>\n<ul>\n<li><strong>It controls access to graphic resources.<\/strong> It allows you to indicate if you want to prevent image files from your website from showing in search results. This is vitally important if you want to keep control over any infographics and images with technical product information that you may have. That way, anyone interested in that information can, in the first instance, only access it by visiting our website.<\/li>\n<li><strong>Restrict access to certain web pages<\/strong>. Websites are made up of many pages, and it can be useful to restrict the indexing of pages that you don&#8217;t want to appear in search results. There are many reasons for this. Generally, it is so that crawler visits don&#8217;t negatively affect the performance of our web server, and to support our SEO (avoiding ranking content that isn&#8217;t relevant and focusing our efforts on giving prominence to the content we do want to rank).<\/li>\n<li><strong>Block access to files and directories.<\/strong> It is very useful for stopping crawlers from poking around in directories and files that are only resources for the website to work properly, that contain information exclusive to certain users, or that are simply duplicate content.<\/li>\n<\/ul>\n<h2>2. How do you create a robots.txt file?<\/h2>\n<p>Although any default installation of a <a href=\"https:\/\/mailrelay.com\/en\/glossary\/content-management-system-cms\/\" target=\"_blank\" rel=\"noopener\">CMS<\/a> such as <a href=\"https:\/\/mailrelay.com\/en\/glossary\/wordpress\/\" target=\"_blank\" rel=\"noopener\">WordPress<\/a> creates a robots.txt file by default, you can also easily create one yourself: using a plain text editor, create a plain text file in ASCII or UTF-8 format and put the indexing instructions you want inside it.<\/p>\n<p>Just below we will show some of the most common commands or instructions used in robots.txt.<\/p>\n<h2>3. robots.txt commands<\/h2>\n<p>The most commonly used commands in the robots.txt document are:<\/p>\n<p><strong>User-agent:<\/strong> also called the user agent, it is used to tell each search engine robot or spider what you want from it. It is important to note that the instructions for each crawler are given together, that is, a single instance is used for Googlebot (Google search engine) to tell it what it is and isn&#8217;t allowed to do.<\/p>\n<p>Its basic syntax is:<\/p>\n<ul>\n<li><strong>User-agent:<\/strong> [the specific robot the rules apply to]<\/li>\n<li><strong>Disallow:<\/strong> tells the robot that it must not access or index a specific URL, subdirectory or directory.<\/li>\n<li><strong>Disallow:<\/strong> [the directory you want to block]<\/li>\n<li><strong>Allow:<\/strong> just the opposite of Disallow:, in this case you tell the user agent that it may access and index a specific URL, subdirectory or directory.<\/li>\n<\/ul>\n<h2>4. Examples for robots.txt<\/h2>\n<p>Here are some examples of the bots or agents of the main search engines:<\/p>\n<ul>\n<li>Googlebot (Google search engine)<\/li>\n<li>Googlebot-Image (Google-image search)<\/li>\n<li>Adsbot-Google (Google AdWords)<\/li>\n<li>Slurp (Yahoo)<\/li>\n<li>bingbot (Bing)<\/li>\n<\/ul>\n<p>Here are some examples of lines that you can place in robots.txt and what each one is for:<\/p>\n<ul>\n<li>All agents are forbidden to access those directories\/files:<\/li>\n<\/ul>\n<p><code>User-agent: \\\\\\*<\/code><\/p>\n<p><code>Disallow: \/wp-admin\/<\/code><\/p>\n<p><code>Disallow: \/temp\/<\/code><\/p>\n<p><code>Disallow: \/precios.shtml<\/code><\/p>\n<ul>\n<li>Block Googlebot-Image from all the images on the website:<\/li>\n<\/ul>\n<p><code>User Agent: Googlebot-Image<\/code><\/p>\n<p><code>Disallow: \/<\/code><\/p>\n<ul>\n<li>Block all PDF files from Googlebot:<\/li>\n<\/ul>\n<p><code>User-agent: Googlebot<\/code><\/p>\n<p><code>Disallow: \/\\\\\\*.pdf$<\/code><\/p>\n\n<h2 class=\"wp-block-heading\">Related entries<\/h2>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/email-service-provider-esp\/\">ESP (email service provider)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/digital-advertising\/\">Digital Advertising<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/display-advertising\/\">Display advertising<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/programmatic-advertising\/\">Programmatic Advertising<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/ads\/\">Ads<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/advertorial\/\">Advertorial<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mailrelay.com\/en\/glossary\/smtp-port\/\">SMTP port<\/a><\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">Discover how <a href=\"https:\/\/mailrelay.com\/en\/\">Mailrelay<\/a> can help you with your email marketing strategy.<\/p>\n","protected":false},"template":"","class_list":["post-71776","glossary","type-glossary","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Robots.txt - Mailrelay<\/title>\n<meta name=\"description\" content=\"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Robots.txt - Mailrelay\" \/>\n<meta property=\"og:description\" content=\"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/\" \/>\n<meta property=\"og:site_name\" content=\"Mailrelay\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Mailrelay\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-02T15:15:11+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@mailrelay\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/glossary\\\/robots-txt\\\/\",\"url\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/glossary\\\/robots-txt\\\/\",\"name\":\"Robots.txt - Mailrelay\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#website\"},\"datePublished\":\"2023-07-13T20:49:01+00:00\",\"dateModified\":\"2026-10-02T15:15:11+00:00\",\"description\":\"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/glossary\\\/robots-txt\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mailrelay.com\\\/en\\\/glossary\\\/robots-txt\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/glossary\\\/robots-txt\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Robots.txt\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/\",\"name\":\"Mailrelay\",\"description\":\"Mailrelay.com - Email Marketing Software\",\"publisher\":{\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#organization\",\"name\":\"Mailrelay\",\"url\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mailrelay.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mailrelay-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/mailrelay.com\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/mailrelay-logo.jpg\",\"width\":613,\"height\":291,\"caption\":\"Mailrelay\"},\"image\":{\"@id\":\"https:\\\/\\\/mailrelay.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Mailrelay\\\/\",\"https:\\\/\\\/x.com\\\/mailrelay\",\"https:\\\/\\\/www.youtube.com\\\/mailrelay-email-marketing\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Robots.txt - Mailrelay","description":"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/","og_locale":"en_US","og_type":"article","og_title":"Robots.txt - Mailrelay","og_description":"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.","og_url":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/","og_site_name":"Mailrelay","article_publisher":"https:\/\/www.facebook.com\/Mailrelay\/","article_modified_time":"2026-10-02T15:15:11+00:00","twitter_card":"summary_large_image","twitter_site":"@mailrelay","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/","url":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/","name":"Robots.txt - Mailrelay","isPartOf":{"@id":"https:\/\/mailrelay.com\/en\/#website"},"datePublished":"2023-07-13T20:49:01+00:00","dateModified":"2026-10-02T15:15:11+00:00","description":"The robots.txt file is a document that tells the indexing spiders of search engines which parts of a website they may index.","breadcrumb":{"@id":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/mailrelay.com\/en\/glossary\/robots-txt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mailrelay.com\/en\/"},{"@type":"ListItem","position":2,"name":"Robots.txt"}]},{"@type":"WebSite","@id":"https:\/\/mailrelay.com\/en\/#website","url":"https:\/\/mailrelay.com\/en\/","name":"Mailrelay","description":"Mailrelay.com - Email Marketing Software","publisher":{"@id":"https:\/\/mailrelay.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mailrelay.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mailrelay.com\/en\/#organization","name":"Mailrelay","url":"https:\/\/mailrelay.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailrelay.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/mailrelay.com\/wp-content\/uploads\/2019\/05\/mailrelay-logo.jpg","contentUrl":"https:\/\/mailrelay.com\/wp-content\/uploads\/2019\/05\/mailrelay-logo.jpg","width":613,"height":291,"caption":"Mailrelay"},"image":{"@id":"https:\/\/mailrelay.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Mailrelay\/","https:\/\/x.com\/mailrelay","https:\/\/www.youtube.com\/mailrelay-email-marketing"]}]}},"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"Jose Argudo","author_link":"https:\/\/mailrelay.com\/en\/blog\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"The robots.txt file is a document that tells search engine indexing spiders which parts of a website can be indexed and provides a link to the XML-sitemap. Put more simply, a robots.txt file tells search engine crawlers which URLs of a site they can access, but it is in no way a mechanism that prevents&hellip;","_links":{"self":[{"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/glossary\/71776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/types\/glossary"}],"version-history":[{"count":3,"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/glossary\/71776\/revisions"}],"predecessor-version":[{"id":98319,"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/glossary\/71776\/revisions\/98319"}],"wp:attachment":[{"href":"https:\/\/mailrelay.com\/en\/wp-json\/wp\/v2\/media?parent=71776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}