The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. Robots.txt blocked internal resources Wordpress

    Robots.txt blocked internal resources Wordpress

    Intermediate & Advanced SEO
    5 2 985
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mat_C
      Mat_C last edited by

      Hi all,

      We've recently migrated a Wordpress website from staging to live, but the robots.txt was deleted.  I've created the following new one:

      User-agent: *
      Allow: /
      Disallow: /wp-admin/
      Disallow: /wp-includes/
      Disallow: /wp-content/plugins/
      Disallow: /wp-content/cache/
      Disallow: /wp-content/themes/
      Allow: /wp-admin/admin-ajax.php

      However, in the site audit on SemRush,  I now get the mention that a lot of pages have issues with blocked internal resources in robots.txt file. These blocked internal resources are all cached and minified css elements: links, images and scripts.

      Does this mean that Google won't crawl some parts of these pages with blocked resources correctly and thus won't be able to follow these links and index the images? In other words, is this any cause for concern regarding SEO?

      Of course I can change the robots.txt again, but will urls like https://example.com/wp-content/cache/minify/df983.js end up in the index?

      Thanks for your thoughts!

      1 Reply Last reply Reply Quote 1
      • JordanLowry
        JordanLowry last edited by

        Hey there --

        Blocking resources with the robots.txt file prevents search engines from crawling content the no-index tag would be better suited for preventing content from being indexed.

        However, previous best practice would dictate blocking access to /wp-includes/ and /wp-content/ directories, etc but that's no longer necessary.

        Today, Google will fetch all your styling and JavaScript files so they can render your pages completely. Search engines now try to understand your page's layout and presentation as a key part of how they evaluate quality.

        So, yeah this might have some impact on your SEO.

        Also, if you're using a plugin to cache content you should want Google to crawl your cache content. And in my experience, Googlebot does a good job of not indexing /wp-content/ sections.

        So, for your example page, https://example.com/wp-content/cache/minify/df983.js it shouldn't end up in their index.

        Hope this helps some.

        1 Reply Last reply Reply Quote 2
        • Mat_C
          Mat_C last edited by

          Thanks for the clear answer.

          I've changed the robots.txt to:

          User-agent: *
          Allow: /
          Disallow: /wp-admin/
          Disallow: /wp-includes/
          Disallow: /wp-content/themes/
          Allow: /wp-admin/admin-ajax.php

          This should avoid problems with not indexing (parts of) cached content.

          Or should I leave all the Disallows out?

          1 Reply Last reply Reply Quote 0
          • JordanLowry
            JordanLowry last edited by

            I would leave all the disallows out except for the /wp-admin/ section. For example, I'd rewrite the robots.txt file to read:

            User-agent: *
            Disallow: /wp-admin/

            Also, you kind of want Google to index your cached content. In the event your servers go down it will still be able to make your content available.

            I hope that helps. Let me know how that works out for you!

            Mat_C 1 Reply Last reply Reply Quote 1
            • Mat_C
              Mat_C @JordanLowry last edited by

              Thanks for the answer!

              Last question: is /wp-admin/admin-ajax.php an important part that has to be crawled? I found this explanation: https://wordpress.stackexchange.com/questions/190993/why-use-admin-ajax-php-and-how-does-it-work/191073#191073

              However, on this specific website there is no html at all when I check the source code, only one line with 0 on it.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Block session id URLs with robots.txt
                Mat_C
                Mat_C
                1
                4
                130

              • Search Results Pages Blocked in Robots.txt?
                BeckyKey
                BeckyKey
                0
                3
                117

              • Robots.txt Blocking - Best Practices
                ReunionMarketing
                ReunionMarketing
                0
                7
                456

              • Block in robots.txt instead of using canonical?
                RobertFisher
                RobertFisher
                0
                9
                1.6k

              • Robots.txt issue for international websites
                KeriMorgret
                KeriMorgret
                0
                4
                307

              • Files blocked in robot.txt and seo
                john4math
                john4math
                0
                4
                344

              • Robots.txt is blocking Wordpress Pages from Googlebot?
                Desiree-CP
                Desiree-CP
                0
                4
                10.7k

              • Block all search results (dynamic) in robots.txt?
                onwebtoday
                onwebtoday
                0
                9
                4.8k

              Get started with Moz Pro!

              Unlock the power of advanced SEO tools and data-driven insights.

              Start my free trial
              Products
              • Moz Pro
              • Moz Local
              • Moz API
              • Moz Data
              • STAT
              • Product Updates
              Moz Solutions
              • SMB Solutions
              • Agency Solutions
              • Enterprise Solutions
              • Digital Marketers
              Free SEO Tools
              • Domain Authority Checker
              • Link Explorer
              • Keyword Explorer
              • Competitive Research
              • Brand Authority Checker
              • Local Citation Checker
              • MozBar Extension
              • MozCast
              Resources
              • Blog
              • SEO Learning Center
              • Help Hub
              • Beginner's Guide to SEO
              • How-to Guides
              • Moz Academy
              • API Docs
              About Moz
              • About
              • Team
              • Careers
              • Contact
              Why Moz
              • Case Studies
              • Testimonials
              Get Involved
              • Become an Affiliate
              • MozCon
              • Webinars
              • Practical Marketer Series
              • MozPod
              Connect with us

              Contact the Help team

              Join our newsletter
              Moz logo
              © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
              • Accessibility
              • Terms of Use
              • Privacy