{"id":15785,"date":"2025-11-27T10:00:32","date_gmt":"2025-11-27T10:00:32","guid":{"rendered":"https:\/\/www.wscubetech.com\/blog\/?p=15785"},"modified":"2026-01-20T10:06:34","modified_gmt":"2026-01-20T10:06:34","slug":"robots-txt","status":"publish","type":"post","link":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/","title":{"rendered":"What is Robots.txt File &amp; How to Create it? Sample &amp; Examples"},"content":{"rendered":"\n<p>If you want search engines to crawl your website correctly, the robots txt file becomes one of the first things you must set up. We use the robots txt file in <a href=\"https:\/\/www.wscubetech.com\/blog\/what-is-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">SEO<\/a> to tell Google which pages you want them to access and which ones they should avoid.&nbsp;<\/p>\n\n\n\n<p>If you have a website, then you need to know that every unnecessary crawl wastes time and crawl budget. That\u2019s exactly where robots.txt helps.&nbsp;<\/p>\n\n\n\n<p>It controls what search engines can explore, protects private sections like admin folders, and ensures Google reads your site efficiently. A simple text file can completely change how your site appears in search results.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Robots.txt File?<\/h2>\n\n\n\n<p>A robots.txt file is a plain text file placed in your website\u2019s root folder. It guides search engine bots on which pages they can crawl and which they must ignore. From an SEO point of view, it helps you manage crawl budget, prevent indexing of unwanted URLs, and keep private or duplicate sections out of search results.&nbsp;<\/p>\n\n\n\n<p>Robots.txt is not a security tool. It only offers instructions to bots. But when you use it correctly, you give search engines a clean path to follow, improving your website\u2019s technical SEO, crawl efficiency, and overall online visibility.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Robots.txt File Sample<\/h2>\n\n\n\n<p>This is a sample robots txt file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/admin\/\nAllow: \/\n\nSitemap: https:\/\/example.com\/sitemap.xml<\/code><\/pre>\n\n\n\n<p><strong>These are the components of robots txt file with meaning:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Component<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>User-agent<\/td><td>Defines which bot the rule applies to (e.g., Googlebot, Bingbot, all bots using *).<\/td><\/tr><tr><td>Disallow<\/td><td>Tells bots which pages or directories they must not crawl.<\/td><\/tr><tr><td>Allow<\/td><td>Specifies exceptions inside a disallowed section that bots can still crawl.<\/td><\/tr><tr><td>Sitemap<\/td><td>Provides the link to the XML sitemap for better crawling and indexing.<\/td><\/tr><tr><td>Wildcard (*)<\/td><td>Used to target multiple URLs or patterns.<\/td><\/tr><tr><td>$ Symbol<\/td><td>Means \u201cend of URL\u201d \u2014 useful for blocking specific file types.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How Robots.txt File Works?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Search engine bots visit your domain first<\/h3>\n\n\n\n<p>Before crawling anything, Googlebot or Bingbot visits yourwebsite.com\/robots.txt. This is the first file they read. If it exists, bots follow the rules; if not, they assume everything is allowed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Bots identify who the rule is for (User-Agent)<\/h3>\n\n\n\n<p>The file starts with \u201cUser-agent\u201d. This tells which bot the rule applies to.<\/p>\n\n\n\n<p><strong>Example:&nbsp;<\/strong><\/p>\n\n\n\n<p><em>User-agent: Googlebot <\/em>controls only Google\u2019s main crawler.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Bots read what is blocked (Disallow)<\/h3>\n\n\n\n<p>The \u201cDisallow\u201d directive tells bots which pages or folders they should not crawl.<\/p>\n\n\n\n<p><strong>Example:&nbsp;<\/strong><\/p>\n\n\n\n<p><em>Disallow: \/admin\/<\/em> blocks all admin pages from crawling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Bots read what is allowed (Allow)<\/h3>\n\n\n\n<p>If there are exceptions inside a blocked folder, the \u201cAllow\u201d directive clarifies what bots can crawl.<\/p>\n\n\n\n<p><strong>Example:&nbsp;<\/strong><\/p>\n\n\n\n<p><em>Allow: \/admin\/help-page\/<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Bots follow hints about site structure (Sitemap)<\/h3>\n\n\n\n<p>A sitemap URL placed in robots.txt helps bots quickly find all important pages to crawl.<\/p>\n\n\n\n<p><strong>Example:&nbsp;<\/strong><\/p>\n\n\n\n<p><em>Sitemap: https:\/\/example.com\/sitemap.xml<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Bots follow rules but are not forced<\/h3>\n\n\n\n<p>Robots.txt is a guideline, not a law. Good bots follow it; harmful or unknown bots may ignore it. But for SEO, Google and all major crawlers fully respect it.<\/p>\n\n\n\n    <!-- LOTTIE SCRIPT -->\n    <script src=\"https:\/\/unpkg.com\/@lottiefiles\/lottie-player@latest\/dist\/lottie-player.js\"><\/script>\n\n    <section class=\"wscube-courses\">\n        <div class=\"container\">\n            <h3 class=\"mb-4\">Recommended Professional <\/br> Certificates<\/h3>\n\n            <div class=\"owl-carousel courseOwl\">\n\n                \n                    \n                    <div class=\"course-card card-r rounded-4\">\n\n                        <!-- \u2705 SINGLE MEDIA DIV (FIXED) -->\n                        <div class=\"course-media\"\n                             data-lottie=\"https:\/\/www.wscubetech.com\/uploads\/images\/courses\/json-images\/digital-marketing.json\"\n                             data-fallback=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/themes\/newwscube\/assets\/imges\/Image.png\">\n                        <\/div>\n\n                        <div class=\"card-body\">\n                            <h5>Digital Marketing Mentorship Program<\/h5>\n\n                            <p class=\"rating\">\n                                4.9 \u2605\u2605\u2605\u2605\u2605\n                                (19476)\n                            <\/p>\n\n                            <ul class=\"course-meta\">\n                                <li>\ud83d\udc64 20000 Learners<\/li>\n                                <li>\u23f1 20 Weeks<\/li>\n                            <\/ul>\n\n                            <div class=\"mt-3\">\n                                                                    <a href=\"https:\/\/www.wscubetech.com\/digital-marketing-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                       target=\"_blank\"\n                                       class=\"btn view-btn btn-sm\">\n                                        View Brochure\n                                    <\/a>\n                                \n                                <a target=\"_blank\"\n                                   href=\"https:\/\/www.wscubetech.com\/digital-marketing-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                   class=\"btn btn-outline-secondary btn-sm\">\n                                    Learn More\n                                <\/a>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                \n                    \n                    <div class=\"course-card card-r rounded-4\">\n\n                        <!-- \u2705 SINGLE MEDIA DIV (FIXED) -->\n                        <div class=\"course-media\"\n                             data-lottie=\"https:\/\/www.wscubetech.com\/uploads\/images\/courses\/json-images\/ai-dm-course.json\"\n                             data-fallback=\"https:\/\/deen3evddmddt.cloudfront.net\/uploads\/courses-images\/advanced-ai-marketing-bootcamp.webp\">\n                        <\/div>\n\n                        <div class=\"card-body\">\n                            <h5>Advanced AI Marketing Bootcamp<\/h5>\n\n                            <p class=\"rating\">\n                                4.9 \u2605\u2605\u2605\u2605\u2605\n                                (18789)\n                            <\/p>\n\n                            <ul class=\"course-meta\">\n                                <li>\ud83d\udc64  Learners<\/li>\n                                <li>\u23f1 5 Weeks<\/li>\n                            <\/ul>\n\n                            <div class=\"mt-3\">\n                                                                    <a href=\"https:\/\/www.wscubetech.com\/advanced-ai-marketing-bootcamp?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                       target=\"_blank\"\n                                       class=\"btn view-btn btn-sm\">\n                                        View Brochure\n                                    <\/a>\n                                \n                                <a target=\"_blank\"\n                                   href=\"https:\/\/www.wscubetech.com\/advanced-ai-marketing-bootcamp?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                   class=\"btn btn-outline-secondary btn-sm\">\n                                    Learn More\n                                <\/a>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                \n                    \n                    <div class=\"course-card card-r rounded-4\">\n\n                        <!-- \u2705 SINGLE MEDIA DIV (FIXED) -->\n                        <div class=\"course-media\"\n                             data-lottie=\"https:\/\/www.wscubetech.com\/uploads\/images\/courses\/json-images\/performance_marketing.json\"\n                             data-fallback=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/themes\/newwscube\/assets\/imges\/Image.png\">\n                        <\/div>\n\n                        <div class=\"card-body\">\n                            <h5>Performance Marketing Bootcamp<\/h5>\n\n                            <p class=\"rating\">\n                                4.9 \u2605\u2605\u2605\u2605\u2605\n                                (919)\n                            <\/p>\n\n                            <ul class=\"course-meta\">\n                                <li>\ud83d\udc64 17000 Learners<\/li>\n                                <li>\u23f1 8 Weeks<\/li>\n                            <\/ul>\n\n                            <div class=\"mt-3\">\n                                                                    <a href=\"https:\/\/www.wscubetech.com\/performance-marketing-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                       target=\"_blank\"\n                                       class=\"btn view-btn btn-sm\">\n                                        View Brochure\n                                    <\/a>\n                                \n                                <a target=\"_blank\"\n                                   href=\"https:\/\/www.wscubetech.com\/performance-marketing-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                   class=\"btn btn-outline-secondary btn-sm\">\n                                    Learn More\n                                <\/a>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                \n                    \n                    <div class=\"course-card card-r rounded-4\">\n\n                        <!-- \u2705 SINGLE MEDIA DIV (FIXED) -->\n                        <div class=\"course-media\"\n                             data-lottie=\"https:\/\/www.wscubetech.com\/uploads\/images\/courses\/json-images\/SEO_json.json\"\n                             data-fallback=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/themes\/newwscube\/assets\/imges\/Image.png\">\n                        <\/div>\n\n                        <div class=\"card-body\">\n                            <h5>SEO Specialist Bootcamp<\/h5>\n\n                            <p class=\"rating\">\n                                4.9 \u2605\u2605\u2605\u2605\u2605\n                                (6983)\n                            <\/p>\n\n                            <ul class=\"course-meta\">\n                                <li>\ud83d\udc64 18000 Learners<\/li>\n                                <li>\u23f1 6 Weeks<\/li>\n                            <\/ul>\n\n                            <div class=\"mt-3\">\n                                                                    <a href=\"https:\/\/www.wscubetech.com\/seo-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                       target=\"_blank\"\n                                       class=\"btn view-btn btn-sm\">\n                                        View Brochure\n                                    <\/a>\n                                \n                                <a target=\"_blank\"\n                                   href=\"https:\/\/www.wscubetech.com\/seo-course?utm_source=WsBlog&#038;utm_medium=blog_course_slider&#038;utm_campaign=SEO\"\n                                   class=\"btn btn-outline-secondary btn-sm\">\n                                    Learn More\n                                <\/a>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                \n            <\/div>\n        <\/div>\n    <\/section>\n\n    \n\n\n\n<h2 class=\"wp-block-heading\">Importance of Robots txt File<\/h2>\n\n\n\n<p>These are the benefits of robots txt file for a website:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Controls What Search Engines Can Access<\/h3>\n\n\n\n<p>Robots.txt helps us decide which pages should appear in Google and which must stay private. This includes admin areas, login pages, filters, backend URLs, or incomplete content that shouldn\u2019t be indexed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Saves Crawl Budget on Large Websites<\/h3>\n\n\n\n<p>If your site has thousands of URLs, Google may not crawl everything. Robots.txt ensures bots spend their crawl time only on important pages, improving indexing speed and SEO performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Prevents Duplicate, Thin, or Irrelevant Pages From Indexing<\/h3>\n\n\n\n<p>E-commerce filters, search pages, tags, and archives can create messy duplicate URLs. Robots.txt lets us block them easily and maintain clean search results.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Helps With Site Organization and Clear Crawl Paths<\/h3>\n\n\n\n<p>When bots see a well-structured robots.txt and sitemap inclusion, crawling becomes faster, smoother, and more accurate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Protects Sensitive Sections (Not Security, but Instructions)<\/h3>\n\n\n\n<p>While it doesn\u2019t secure a folder, it instructs bots to avoid crawling backend resources, confidential areas, and temporary pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Robots.txt Examples<\/h2>\n\n\n\n<p>These are some examples of robots txt file for different websites:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress Robots.txt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/wp-admin\/\nAllow: \/wp-admin\/admin-ajax.php\nDisallow: \/?s=\nDisallow: \/trackback\/\nSitemap: https:\/\/example.com\/sitemap_index.xml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">E-Commerce Store Robots.txt&nbsp;<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/checkout\/\nDisallow: \/cart\/\nDisallow: \/account\/\nDisallow: \/search\/\nAllow: \/\nSitemap: https:\/\/store.com\/sitemap.xml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Robots.txt Blocking Staging or Development Sites<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Robots.txt for a Blog With Categories &amp; Tags<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/tag\/\nDisallow: \/category\/\nAllow: \/\nSitemap: https:\/\/blogsite.com\/sitemap.xml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Advanced Robots.txt Example With Wildcards<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/*?ref=\nDisallow: \/*.pdf$\nAllow: \/\nSitemap: https:\/\/example.com\/sitemap.xml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Robots.txt Example for Large News Website<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/private\/\nDisallow: \/internal\/\nDisallow: \/drafts\/\nAllow: \/\nSitemap: https:\/\/newsportal.com\/news-sitemap.xml\nSitemap: https:\/\/newsportal.com\/video-sitemap.xml<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to Create Robots.txt File for Website?<\/h2>\n\n\n\n<p>This is how to create robots.txt file:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Decide What You Want Search Engines to Crawl (Planning)<\/h3>\n\n\n\n<p>Before you create a robots.txt file, you must be clear about what we want search engines to see and what they should skip.&nbsp;<\/p>\n\n\n\n<p>At <a href=\"https:\/\/www.wscubetech.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WsCube Tech<\/a>, we allow all important pages (courses, tutorials, blogs, etc.) and block sections like 404 pages, admin area, portfolio, internal campaigns, and PDFs that don\u2019t need indexing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Open a Plain Text Editor or SEO Plugin<\/h3>\n\n\n\n<p>To create a robots.txt file, open any plain text editor like Notepad (Windows), TextEdit (Mac), or code editor (VS Code).<\/p>\n\n\n\n<p>If your site is on WordPress, you can also use SEO plugins like Yoast, Rank Math, or server-level file manager (cPanel \/ hosting panel) to manage robots.txt directly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Start With User-Agent and Basic Allow Rule<\/h3>\n\n\n\n<p>The first line of a robots.txt file tells which crawlers the rules apply to. For WsCube Tech, we want to define rules for all bots, so we use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nAllow: \/\nAllow: \/blog\/wp-admin\/admin-ajax.php<\/code><\/pre>\n\n\n\n<p>Here,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>User-agent: *<\/em> \u2192 all bots (Google, Bing, etc.).<\/li>\n\n\n\n<li><em>Allow: \/ <\/em>\u2192 let them crawl the full site.<\/li>\n\n\n\n<li><em>Allow: \/blog\/wp-admin\/admin-ajax.php<\/em> \u2192 specifically allow this important AJAX file even if admin is blocked later.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Add Disallow Rules for Unwanted Sections<\/h3>\n\n\n\n<p>Next, we tell bots what not to crawl. At WsCube Tech, we don\u2019t want certain URLs like 404 page, portfolio, certain events, refer-and-earn, or plugin folders to be crawled or indexed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Disallow: \/404\nDisallow: \/portfolio\nDisallow: \/blog\/wp-admin\/\nDisallow: \/blog\/wp-content\/plugins\/\nDisallow: \/events\/\nDisallow: \/refer-and-earn\nDisallow: \/challenges\nDisallow: \/?ref\nDisallow: \/*.pdf$<\/code><\/pre>\n\n\n\n<p>These rules avoid crawling non-SEO pages, internal campaigns, and all .pdf files.<\/p>\n\n\n\n<p>\/*.pdf$ blocks all URLs ending with .pdf, which is useful when we don\u2019t want PDFs indexed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Add Sitemap URLs for Better Crawling<\/h3>\n\n\n\n<p>To make crawling easier, we list all important sitemaps in the robots.txt file. WsCube Tech has multiple sitemaps for different sections of the website:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Sitemaps\nSitemap: https:\/\/www.wscubetech.com\/sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/categories-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/courses-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/tutorials-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/programs-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/quizzes-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/compiler-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/free-courses-sitemap.xml\nSitemap: https:\/\/www.wscubetech.com\/blog\/sitemap_index.xml<\/code><\/pre>\n\n\n\n<p>This helps search engines quickly discover all key pages: courses, tutorials, programs, quizzes, blog articles, and more.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Save the File as robots.txt<\/h3>\n\n\n\n<p>Once you add all rules, save the file as: robots.txt (not .doc, .rtf, or anything else \u2014 it must be a plain .txt file).<\/p>\n\n\n\n<p>Make sure there are no extra formatting styles or hidden characters. It should be a clean text file only.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Upload Robots.txt to the Root Folder of Your Domain<\/h3>\n\n\n\n<p>Now you upload this file to your website\u2019s root directory (public_html or root of the domain) via:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>cPanel or hosting file manager<\/li>\n\n\n\n<li>FTP\/SFTP (FileZilla, WinSCP, etc.)<\/li>\n\n\n\n<li>Or directly via your server config if you\u2019re on a VPS\/cloud setup<\/li>\n<\/ul>\n\n\n\n<p>For WsCube Tech, the final URL is:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.wscubetech.com\/robots.txt\">https:\/\/www.wscubetech.com\/robots.txt<\/a><\/p>\n\n\n\n<p>This is where every search engine bot will look for it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Check Your Robots.txt File in the Browser<\/h3>\n\n\n\n<p>To make sure everything is correct, open your robots.txt in any browser:<\/p>\n\n\n\n<p><strong>Visit<\/strong>: <a href=\"https:\/\/www.wscubetech.com\/robots.txt\">https:\/\/www.wscubetech.com\/robots.txt<\/a><\/p>\n\n\n\n<p>If you can see the file content clearly, it means the file is uploaded correctly and publicly accessible to bots.<\/p>\n\n\n\n<p>You should do the same for your own domain once your robots.txt is ready.<\/p>\n\n\n\n<p><strong>Final Version: WsCube Tech Robots.txt<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nAllow: \/\nAllow: \/blog\/wp-admin\/admin-ajax.php\nDisallow: \/404\nDisallow: \/portfolio\nDisallow: \/blog\/wp-admin\/\nDisallow: \/blog\/wp-content\/plugins\/\nDisallow: \/events\/\nDisallow: \/refer-and-earn\nDisallow: \/challenges\nDisallow: \/?ref\nDisallow: \/*.pdf$\n\n# Host\nHost: https:\/\/www.wscubetech.com\/\n\n# Sitemaps\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/sitemap.xml\">https:\/\/www.wscubetech.com\/sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/categories-sitemap.xml\">https:\/\/www.wscubetech.com\/categories-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/courses-sitemap.xml\">https:\/\/www.wscubetech.com\/courses-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/tutorials-sitemap.xml\">https:\/\/www.wscubetech.com\/tutorials-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/programs-sitemap.xml\">https:\/\/www.wscubetech.com\/programs-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/quizzes-sitemap.xml\">https:\/\/www.wscubetech.com\/quizzes-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/compiler-sitemap.xml\">https:\/\/www.wscubetech.com\/compiler-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/free-courses-sitemap.xml\">https:\/\/www.wscubetech.com\/free-courses-sitemap.xml<\/a>\nSitemap: <a href=\"https:\/\/www.wscubetech.com\/blog\/sitemap_index.xml\">https:\/\/www.wscubetech.com\/blog\/sitemap_index.xml<\/a><\/code><\/pre>\n\n\n\n<p class=\"has-white-color has-vivid-cyan-blue-background-color has-text-color has-background has-link-color wp-elements-34684e7c335bd6186d609aeeb70543f5\"><strong>Read More Digital Marketing Blogs<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><a href=\"https:\/\/www.wscubetech.com\/blog\/digital-marketing-funnel\/\" target=\"_blank\" rel=\"noreferrer noopener\">Digital Marketing Funnel<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/digital-marketing-future\/\" target=\"_blank\" rel=\"noreferrer noopener\">Future of Digital Marketing<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/types-of-digital-marketing\/\" target=\"_blank\" rel=\"noreferrer noopener\">Types of Digital Marketing<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.wscubetech.com\/blog\/benefits-of-digital-marketing\/\" target=\"_blank\" rel=\"noreferrer noopener\">Benefits of Digital Marketing<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/top-latest-digital-marketing-trends\/\" target=\"_blank\" rel=\"noreferrer noopener\">Latest Digital Marketing Trends<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/highest-paying-digital-marketing-jobs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Highest Paying Digital Marketing Jobs<\/a><\/td><\/tr><tr><td><a href=\"https:\/\/www.wscubetech.com\/blog\/digital-marketing-channels\/\" target=\"_blank\" rel=\"noreferrer noopener\">Digital Marketing Channels<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/digital-marketing-roi\/\" target=\"_blank\" rel=\"noreferrer noopener\">Digital Marketing ROI<\/a><\/td><td><a href=\"https:\/\/www.wscubetech.com\/blog\/digital-marketing-objectives\/\" target=\"_blank\" rel=\"noreferrer noopener\">Digital Marketing Objectives<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Most Common User Agents in Robots.txt<\/h2>\n\n\n\n<p>When you use the <em>User-agent: * <\/em>directive in your robots.txt file, it means the rules apply to all crawlers by default. If you add specific user agents after that (like Googlebot or Bingbot), those customized rules will override the general \u201c*\u201d rule for those particular bots.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>User-Agent<\/strong><\/td><td><strong>Company \/ Platform<\/strong><\/td><\/tr><tr><td>Googlebot<\/td><td>Google<\/td><\/tr><tr><td>Googlebot-Mobile<\/td><td>Google<\/td><\/tr><tr><td>Bingbot<\/td><td>Microsoft Bing<\/td><\/tr><tr><td>Slurp<\/td><td>Yahoo<\/td><\/tr><tr><td>DuckDuckBot<\/td><td>DuckDuckGo<\/td><\/tr><tr><td>Baiduspider<\/td><td>Baidu<\/td><\/tr><tr><td>YandexBot<\/td><td>Yandex<\/td><\/tr><tr><td>GPTBot<\/td><td>OpenAI<\/td><\/tr><tr><td>CCBot<\/td><td>CommonCrawl<\/td><\/tr><tr><td>ClaudeBot<\/td><td>Anthropic<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Example using multiple bots in a robots.txt file:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Allow Google full access\nUser-agent: Googlebot\nAllow: \/\n\n# Block Bing completely\nUser-agent: Bingbot\nDisallow: \/\n\n# Block AI crawlers\nUser-agent: GPTBot\nDisallow: \/\n\nUser-agent: CCBot\nDisallow: \/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Where to Upload Robots.txt File?<\/h2>\n\n\n\n<p>You must upload the robots.txt file to the root directory of your website \u2014 not inside any folder. The correct path is:<\/p>\n\n\n\n<p class=\"has-black-color has-text-color has-link-color wp-elements-935ebb4216dfad779c041cc2401d4df7\">https:\/\/yourwebsite.com\/robots.txt<\/p>\n\n\n\n<p><strong>This means:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Place the file in public_html (if using shared hosting)<\/li>\n\n\n\n<li>Or at the root of your domain (if using VPS\/cloud)<\/li>\n<\/ul>\n\n\n\n<p>Search engine bots always check this exact location. If the file is in any other folder, it will not work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Check Robots.txt of a Website?<\/h2>\n\n\n\n<p>Checking a website\u2019s robots.txt file is extremely simple:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Type the URL + \/robots.txt<\/h3>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.wscubetech.com\/robots.txt\">https:\/\/www.wscubetech.com\/robots.txt<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.google.com\/robots.txt\">https:\/\/www.google.com\/robots.txt<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.amazon.in\/robots.txt\">https:\/\/www.amazon.in\/robots.txt<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. Use Google Search Operators<\/h3>\n\n\n\n<p><strong>Type:<\/strong><\/p>\n\n\n\n<p><em>site:example.com robots.txt<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Use SEO Tools or GSC Tester<\/h3>\n\n\n\n<p>Tools like Ahrefs, Screaming Frog, and the Google Search Console robots testing tool can analyse it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advanced Robots.txt Tips for SEO<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Block Parameter-Based URLs to Avoid Duplicate Content<\/h3>\n\n\n\n<p>URLs generated by filters, sorting, or tracking parameters can create thousands of duplicate pages. Use patterns like \/*?ref= to block them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allow Essential JS, CSS, and AJAX Files<\/h3>\n\n\n\n<p>Google needs these to properly render your website. Never block theme files, layout CSS, or important scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use \u201c$\u201d to Block Specific File Types<\/h3>\n\n\n\n<p>For example, blocking all PDFs:<\/p>\n\n\n\n<p><em>Disallow: \/*.pdf$<\/em><\/p>\n\n\n\n<p>This ensures only full URLs ending with .pdf are blocked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Multiple Sitemaps for Large Websites<\/h3>\n\n\n\n<p>If your site has blogs, courses, tutorials, or categories, separate sitemaps improve crawling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use Wildcards Smartly to Clean URL Patterns<\/h3>\n\n\n\n<p>Wildcards help block groups of URLs without listing each manually:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Disallow: \/*utm_source=\nDisallow: \/*?sort=<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Robots.txt Best Practices for SEO<\/h2>\n\n\n\n<p><strong>1. Keep the File Simple and Clean: <\/strong>Avoid overly complex rules. Search engines understand clarity, not confusion.<\/p>\n\n\n\n<p><strong>2. Always Add the Sitemap Link<\/strong>: It speeds up discovery of important URLs and improves indexing efficiency.<\/p>\n\n\n\n<p><strong>3. Never Block Important Pages Accidentally: <\/strong>Check twice before disallowing folders like \/wp-content\/, \/blog\/, or \/courses\/.<\/p>\n\n\n\n<p><strong>4. Test the File After Updating It: <\/strong>Even a small typo can block your entire website from crawling.<\/p>\n\n\n\n<p><strong>5. Use Disallow Only When Necessary:<\/strong> Sometimes canonical tags or noindex tags may be better solutions, depending on the situation.<\/p>\n\n\n\n        <div class=\"container position-relative\">\n            <div class=\"row pb-4\">\n                <h2 style=\"font-size:32px\">Upcoming Masterclass<\/h2>\n                <p>Attend our live classes led by experienced and desiccated instructors of Wscube Tech.<\/p>\n            <\/div>\n            <div class=\"owl-carousel myOwl\">\n                <div class=\"item\">\n                    <a href=\"https:\/\/www.wscubetech.com\/events\/most-in-demand-job-business-analyst-with-genai-skills?utm_source=WsBlog&utm_medium=blog_master_class_slider&utm_campaign=SEO\" target=\"_blank\">\n                        <img decoding=\"async\" src=\"https:\/\/deen3evddmddt.cloudfront.net\/uploads\/master-class-media\/BusinessdfhdfdfhAnalyst.webp\" alt=\"Most-in-Demand Job - Business Analyst with GenAI Skills\" \/>\n                    <\/a>\n                <\/div>\n                <div class=\"item\">\n                    <a href=\"https:\/\/www.wscubetech.com\/events\/10x-marketing-with-advanced-ai-agents-systems?utm_source=WsBlog&utm_medium=blog_master_class_slider&utm_campaign=SEO\" target=\"_blank\">\n                        <img decoding=\"async\" src=\"https:\/\/deen3evddmddt.cloudfront.net\/uploads\/master-class-media\/Marketing with Advanced AI sdsd.webp\" alt=\"10X Marketing with Advanced AI Agents & Systems\" \/>\n                    <\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes to Avoid in Robots.txt&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Blocking the Entire Website Accidentally<\/h3>\n\n\n\n<p>A small mistake like this can remove your entire site from Google:<\/p>\n\n\n\n<p><em>Disallow: \/<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Blocking Essential CSS and JS Files<\/h3>\n\n\n\n<p>This harms rendering and can drop search rankings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Using Robots.txt for Security<\/h3>\n\n\n\n<p>It only hides paths from good bots \u2014 it cannot protect sensitive folders.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Incorrect Use of Wildcards<\/h3>\n\n\n\n<p>Bad wildcard usage can block many pages unintentionally.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Not Adding Sitemap URLs<\/h3>\n\n\n\n<p>Without sitemap hints, Google may take longer to discover key pages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Placing Robots.txt in the Wrong Folder<\/h3>\n\n\n\n<p>If the file is not in the domain root, bots will not read it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. Using Uppercase\/Lowercase Incorrectly<\/h3>\n\n\n\n<p>Robots.txt is case-sensitive. \/Blog\/ is different from \/blog\/.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.wscubetech.com\/digital-marketing-course?utm_source=WsBlog&amp;utm_medium=Content_Banner&amp;utm_campaign=SEO&amp;utm_page=\/robots.txt\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"252\" src=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course-1024x252.webp\" alt=\"Best Digital Marketing Course\" class=\"wp-image-14518\" srcset=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course-1024x252.webp 1024w, https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course-300x74.webp 300w, https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course-768x189.webp 768w, https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course-1536x378.webp 1536w, https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/09\/best-digital-marketing-course.webp 1546w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs About Robots.txt<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1764165032792\"><strong class=\"schema-faq-question\"><strong>Is robots.txt mandatory?<\/strong><\/strong> <p class=\"schema-faq-answer\">No, but it\u2019s strongly recommended for SEO and crawl control.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165040249\"><strong class=\"schema-faq-question\"><strong>Does robots.txt block indexing?<\/strong><\/strong> <p class=\"schema-faq-answer\">It blocks crawling, not indexing. A blocked page can still appear in Google if another site links to it.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165057784\"><strong class=\"schema-faq-question\"><strong>Is robots.txt case sensitive?<\/strong><\/strong> <p class=\"schema-faq-answer\">Yes. \/Blog\/ and \/blog\/ are treated differently.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165073746\"><strong class=\"schema-faq-question\"><strong>Can robots.txt improve my SEO rankings?<\/strong><\/strong> <p class=\"schema-faq-answer\">Not directly, but it improves crawl efficiency, which indirectly boosts SEO health.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165086399\"><strong class=\"schema-faq-question\"><strong>What is Disallow in robots.txt?<\/strong><\/strong> <p class=\"schema-faq-answer\">It tells bots which folders or pages they must not crawl.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165104980\"><strong class=\"schema-faq-question\"><strong>What is Allow in robots.txt?<\/strong><\/strong> <p class=\"schema-faq-answer\">It specifies which URLs bots can crawl even inside blocked sections.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165126167\"><strong class=\"schema-faq-question\"><strong>What happens if robots.txt is missing?<\/strong><\/strong> <p class=\"schema-faq-answer\">Search engines assume your entire website is open for crawling.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165142488\"><strong class=\"schema-faq-question\"><strong>How big can a robots.txt file be?<\/strong><\/strong> <p class=\"schema-faq-answer\">Google recommends keeping it under 500 KB.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165156845\"><strong class=\"schema-faq-question\"><strong>Can I use comments inside robots.txt?<\/strong><\/strong> <p class=\"schema-faq-answer\">Yes. Anything starting with # is a comment.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1764165169876\"><strong class=\"schema-faq-question\"><strong>Should I block admin pages?<\/strong><\/strong> <p class=\"schema-faq-answer\">Yes, you should block backend pages to avoid unnecessary crawling.<\/p> <\/div> <\/div>\n\n\n\n<p class=\"has-white-color has-vivid-cyan-blue-background-color has-text-color has-background has-link-color wp-elements-e1fc883f2a064c2ee23f1a20caaaed0f\"><strong>Explore Our Free Courses<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/semrush\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\">Semrush Course<\/a><\/td><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/google-tag-manager\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\">GTM Course<\/a><\/td><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/blogging\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\">Blogging Course<\/a><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/email-marketing\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><a target=\"_blank\" href=\"https:\/\/www.wscubetech.com\/resources\/email-marketing\/free-course\" rel=\"noreferrer noopener\">Email Marketing Course<\/a><\/td><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/video-editing\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\">Video Editing Course<\/a><\/td><td class=\"has-text-align-left\" data-align=\"left\"><a href=\"https:\/\/www.wscubetech.com\/resources\/affiliate-marketing\/free-course\" target=\"_blank\" rel=\"noreferrer noopener\">Affiliate Marketing Course<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>If you want search engines to crawl your website correctly, the robots txt file becomes one of the first things you must set up. We use the robots txt file in SEO to tell Google which pages you want them to access and which ones they should avoid.&nbsp; If you have a website, then you [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":15854,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-15785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital-marketing"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Robots.txt File &amp; How to Create it? Sample &amp; Examples<\/title>\n<meta name=\"description\" content=\"Learn what is robots.txt, how it works in SEO, with samples &amp; examples, sitemap &amp; disallow rules. Read now to create &amp; test your robots.txt!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Robots.txt File &amp; How to Create it? Sample &amp; Examples\" \/>\n<meta property=\"og:description\" content=\"Learn what is robots.txt, how it works in SEO, with samples &amp; examples, sitemap &amp; disallow rules. Read now to create &amp; test your robots.txt!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/\" \/>\n<meta property=\"og:site_name\" content=\"WsCube Tech Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wscubetech.india\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-27T10:00:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T10:06:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"827\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Virendra Soni\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wscube\" \/>\n<meta name=\"twitter:site\" content=\"@wscube\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virendra Soni\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/\",\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/\",\"name\":\"What is Robots.txt File & How to Create it? Sample & Examples\",\"isPartOf\":{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp\",\"datePublished\":\"2025-11-27T10:00:32+00:00\",\"dateModified\":\"2026-01-20T10:06:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/86f20800856ef0446a922403e609345e\"},\"description\":\"Learn what is robots.txt, how it works in SEO, with samples & examples, sitemap & disallow rules. Read now to create & test your robots.txt!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845\"},{\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage\",\"url\":\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp\",\"contentUrl\":\"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp\",\"width\":827,\"height\":400,\"caption\":\"What is Robots.txt File & How to Create it? Sample & Examples\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.wscubetech.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Robots.txt File &amp; How to Create it? Sample &amp; Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/#website\",\"url\":\"https:\/\/www.wscubetech.com\/blog\/\",\"name\":\"WsCube Tech Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wscubetech.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/86f20800856ef0446a922403e609345e\",\"name\":\"Virendra Soni\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b175c5ff6bbbe5689ba772754de747e391d35e730ac7d25b89036db59128d5b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b175c5ff6bbbe5689ba772754de747e391d35e730ac7d25b89036db59128d5b?s=96&d=mm&r=g\",\"caption\":\"Virendra Soni\"},\"description\":\"Virendra is the Content &amp; SEO Manager at WsCube Tech. He holds 7+ years of experience in blogging, content marketing, SEO, and editing. With B.Tech. in ECE and working for the IT and edtech industry, Virendra holds expertise in turning web pages into traffic magnets. His mantra? Keep it simple, make it memorable, and yes, let Google fall in love with it.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/virendra-soni\/\"],\"url\":\"https:\/\/www.wscubetech.com\/blog\/author\/virendra\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792\",\"position\":1,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792\",\"name\":\"Is robots.txt mandatory?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No, but it\u2019s strongly recommended for SEO and crawl control.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249\",\"position\":2,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249\",\"name\":\"Does robots.txt block indexing?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"It blocks crawling, not indexing. A blocked page can still appear in Google if another site links to it.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784\",\"position\":3,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784\",\"name\":\"Is robots.txt case sensitive?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. \/Blog\/ and \/blog\/ are treated differently.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746\",\"position\":4,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746\",\"name\":\"Can robots.txt improve my SEO rankings?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Not directly, but it improves crawl efficiency, which indirectly boosts SEO health.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399\",\"position\":5,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399\",\"name\":\"What is Disallow in robots.txt?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"It tells bots which folders or pages they must not crawl.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980\",\"position\":6,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980\",\"name\":\"What is Allow in robots.txt?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"It specifies which URLs bots can crawl even inside blocked sections.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167\",\"position\":7,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167\",\"name\":\"What happens if robots.txt is missing?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Search engines assume your entire website is open for crawling.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488\",\"position\":8,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488\",\"name\":\"How big can a robots.txt file be?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Google recommends keeping it under 500 KB.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845\",\"position\":9,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845\",\"name\":\"Can I use comments inside robots.txt?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. Anything starting with # is a comment.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876\",\"position\":10,\"url\":\"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876\",\"name\":\"Should I block admin pages?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, you should block backend pages to avoid unnecessary crawling.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Robots.txt File & How to Create it? Sample & Examples","description":"Learn what is robots.txt, how it works in SEO, with samples & examples, sitemap & disallow rules. Read now to create & test your robots.txt!","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:\/\/www.wscubetech.com\/blog\/robots-txt\/","og_locale":"en_US","og_type":"article","og_title":"What is Robots.txt File & How to Create it? Sample & Examples","og_description":"Learn what is robots.txt, how it works in SEO, with samples & examples, sitemap & disallow rules. Read now to create & test your robots.txt!","og_url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/","og_site_name":"WsCube Tech Blog","article_publisher":"https:\/\/www.facebook.com\/wscubetech.india","article_published_time":"2025-11-27T10:00:32+00:00","article_modified_time":"2026-01-20T10:06:34+00:00","og_image":[{"width":827,"height":400,"url":"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp","type":"image\/webp"}],"author":"Virendra Soni","twitter_card":"summary_large_image","twitter_creator":"@wscube","twitter_site":"@wscube","twitter_misc":{"Written by":"Virendra Soni","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/","url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/","name":"What is Robots.txt File & How to Create it? Sample & Examples","isPartOf":{"@id":"https:\/\/www.wscubetech.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage"},"image":{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp","datePublished":"2025-11-27T10:00:32+00:00","dateModified":"2026-01-20T10:06:34+00:00","author":{"@id":"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/86f20800856ef0446a922403e609345e"},"description":"Learn what is robots.txt, how it works in SEO, with samples & examples, sitemap & disallow rules. Read now to create & test your robots.txt!","breadcrumb":{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845"},{"@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wscubetech.com\/blog\/robots-txt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#primaryimage","url":"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp","contentUrl":"https:\/\/www.wscubetech.com\/blog\/wp-content\/uploads\/2025\/11\/what-is-robots.txt-file.webp","width":827,"height":400,"caption":"What is Robots.txt File & How to Create it? Sample & Examples"},{"@type":"BreadcrumbList","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wscubetech.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is Robots.txt File &amp; How to Create it? Sample &amp; Examples"}]},{"@type":"WebSite","@id":"https:\/\/www.wscubetech.com\/blog\/#website","url":"https:\/\/www.wscubetech.com\/blog\/","name":"WsCube Tech Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wscubetech.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/86f20800856ef0446a922403e609345e","name":"Virendra Soni","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wscubetech.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b175c5ff6bbbe5689ba772754de747e391d35e730ac7d25b89036db59128d5b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b175c5ff6bbbe5689ba772754de747e391d35e730ac7d25b89036db59128d5b?s=96&d=mm&r=g","caption":"Virendra Soni"},"description":"Virendra is the Content &amp; SEO Manager at WsCube Tech. He holds 7+ years of experience in blogging, content marketing, SEO, and editing. With B.Tech. in ECE and working for the IT and edtech industry, Virendra holds expertise in turning web pages into traffic magnets. His mantra? Keep it simple, make it memorable, and yes, let Google fall in love with it.","sameAs":["https:\/\/www.linkedin.com\/in\/virendra-soni\/"],"url":"https:\/\/www.wscubetech.com\/blog\/author\/virendra\/"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792","position":1,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165032792","name":"Is robots.txt mandatory?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"No, but it\u2019s strongly recommended for SEO and crawl control.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249","position":2,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165040249","name":"Does robots.txt block indexing?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"It blocks crawling, not indexing. A blocked page can still appear in Google if another site links to it.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784","position":3,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165057784","name":"Is robots.txt case sensitive?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes. \/Blog\/ and \/blog\/ are treated differently.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746","position":4,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165073746","name":"Can robots.txt improve my SEO rankings?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Not directly, but it improves crawl efficiency, which indirectly boosts SEO health.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399","position":5,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165086399","name":"What is Disallow in robots.txt?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"It tells bots which folders or pages they must not crawl.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980","position":6,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165104980","name":"What is Allow in robots.txt?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"It specifies which URLs bots can crawl even inside blocked sections.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167","position":7,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165126167","name":"What happens if robots.txt is missing?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Search engines assume your entire website is open for crawling.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488","position":8,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165142488","name":"How big can a robots.txt file be?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Google recommends keeping it under 500 KB.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845","position":9,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165156845","name":"Can I use comments inside robots.txt?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes. Anything starting with # is a comment.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876","position":10,"url":"https:\/\/www.wscubetech.com\/blog\/robots-txt\/#faq-question-1764165169876","name":"Should I block admin pages?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, you should block backend pages to avoid unnecessary crawling.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/posts\/15785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/comments?post=15785"}],"version-history":[{"count":17,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/posts\/15785\/revisions"}],"predecessor-version":[{"id":16240,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/posts\/15785\/revisions\/16240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/media\/15854"}],"wp:attachment":[{"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/media?parent=15785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/categories?post=15785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wscubetech.com\/blog\/wp-json\/wp\/v2\/tags?post=15785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}