How to Quickly Fix Common Robots.txt Issues for Your Website

Victoria Oluwaferanmi
4 min readMay 10, 2023

Google Search Console is a powerful tool that allows website owners and webmasters to monitor the performance of their website in Google’s search results. One of the key features of Search Console is the ability to identify and fix page indexing issues, such as those caused by blocked robots.txt files.

In this article I will explain how to fix the issue “Page is not indexed, blocked by robots.txt ”. To improve comprehension, I will explain the Page indexing issues and Robots.txt function for Google Search Console.

Page Indexing Issues

Page indexing issues occur when Google is unable to crawl and index a page on your website. This can happen for a variety of reasons, such as a misconfigured robots.txt file, server errors, or content that is not optimized for search engines.

Robots.txt

The robots.txt file is a text file that sits in the root directory of your website and tells search engine robots which pages or sections of your website they are allowed to access and index. If a page on your website is being blocked by the robots.txt file, it means that Google’s search bots won’t be able to crawl and index that page.

How to Fix Page Indexing Blocked by Robots.txt

If you see any errors related to page indexing, such as “Page is not indexed, page blocked by robots.txt file ”, it means that Google is not able to index that page. You need to update the file to allow Google to crawl and index the page.

Step1 — Check for page indexing issues in Search Console.

Follow these steps:

  1. Log in to your Google Search Console account.
  2. Select the website for which you want to check for indexing issues.
  3. Click on the “Index” menu, and then select “Pages”.
  4. Look for any “Errors” or “Valid with warnings” issues related to page indexing. You will be able to find the page(url) with the issue.

Step 2 — Locate the “robots.txt” file

This file is usually located in the root directory of your website, e.g., “https://example.com/robots.txt". You can access it by entering the URL in your browser. change your website URL with example.com

Step 3 — Edit the “robots.txt” file:

If you find any pages(url) that are being blocked by the robots.txt file, you need to update the file to remove any “Disallow” directives that are blocking those pages.

For example using the below as your robots.txt file

User-agent: *
Disallow:/about

The “https://example.com/about” is the page (url) with indexing issue. To fix this, you remove the page from the “Disallow”.

User-agent: *
Disallow:

You have successfully disallow the page index from being blocked.

More Indexing Cases

If you want Google to index your entire website, your robots.txt file should look like this:

User-agent: *
Disallow:

If you have specific pages or directories that you want to block from being indexed, you can modify the code accordingly. For example, if you wanted to block the /private directory from being indexed, you would add the following line to the code:

User-agent: *
Disallow: /private/

To permit certain pages to be indexed by search engines, you can include a “Allow” directive in your website’s robots.txt file. This directive specifies the pages or directories that the search engine robots are allowed to access and index. For example, if you want to allow the search engine robots to index a page located at “https://www.example.com/my-page/", you can add the following code to your robots.txt file:

User-agent: *
Allow: /my-page/
Disallow: /private/

Step 4 — Submit a reindex request

After making changes to the “robots.txt” file, you may need to submit a request to the search engine to reindex your website. This will allow the search engine to discover the changes you made and update its index accordingly.

Please note that changes to the “robots.txt” file may take some time to take effect, as it may take a while for search engines to recrawl your site.

Note

You may get an indexing issue for the page(s) you want to hide from everyone using the disallow, you may then remove the page (url ) from indexing in your google search console account.

Conclusion

By checking for errors in Google Search Console and looking for disallow directives, you can quickly fix common robots.txt issues. These methods ensure that your website’s pages are being crawled and indexed by search engine robots as intended. By taking the necessary steps to fix any issues with your robots.txt file, you can improve your website’s search engine visibility and ultimately drive more traffic to your site.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Victoria Oluwaferanmi
Victoria Oluwaferanmi

No responses yet

Write a response