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. On-Page / Site Optimization
    4. Correct robots.txt for WordPress

    Correct robots.txt for WordPress

    On-Page / Site Optimization
    5 3 180
    • 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.
    • AslanBarselinov
      AslanBarselinov last edited by

      Hi. So I recently launched a website on WordPress (1 main page and 5 internal pages). The main page got indexed right off the bat, while other pages seem to be blocked by robots.txt. Would you please look at my robots file and tell me what‘s wrong?

      I wanted to block the contact page, plugin elements, users’ comments (I got a discussion space on every page of my website) and website search section (to prevent duplicate pages from appearing in google search results). Looks like one of the lines is blocking every page after ”/“ from indexing, even though everything seems right.

      Thank you so much.

      FzSQkqB.jpg

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

        Just seems overly complex and like there's way more in there than there needs to be

        I'd go with something that 'just' does what you have stated that you want to achieve, and nothing else

        User-Agent: *

        Disallow: /wp-content/plugins/

        Disallow: /comments

        Disallow: /*?s=

        Disallow: /*&s=

        Disallow: /search


        See if that helps

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

          Hi, in addition to the answer that effectdigital gave; another option,optimised for WordPress:

          User-Agent: *
          Allow: /wp-content/uploads/
          Disallow: /wp-content/plugins/
          Disallow: /wp-admin/
          Disallow: /readme.html
          Disallow: /refer/

          Sitemap: http://www.example.com/post-sitemap.xml
          Sitemap: http://www.example.com/page-sitemap.xml

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

            I have edited it down to

            User-Agent: *
            
            Allow: /wp-content/uploads/
            Disallow: /wp-content/plugins/
            Disallow: /wp-admin/
            Disallow: /contact/
            Disallow: /refer/
            
            It didn’t help. I get a “Blocked by robots.txt” message after submitting the URL for indexing in google webmaster tools. I’m really puzzled.
            
            1 Reply Last reply Reply Quote 1
            • jasongmcmahon
              jasongmcmahon last edited by

              Me too, can you upload or screenshot the actual file that you are using

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Two Robots.txt files
                TrulyTravel
                TrulyTravel
                0
                5
                514

              • Robot.txt file issue on wordpress site.
                AlanMosley
                AlanMosley
                0
                8
                229

              • How to exclude URL filter searches in robots.txt
                Everett
                Everett
                0
                9
                8.6k

              • Solve duplicate content issues by using robots.txt
                JohnHuynh
                JohnHuynh
                0
                5
                153

              • Disallow a spammed sub-page from robots.txt
                zigojacko
                zigojacko
                0
                3
                475

              • Wordpress categories tags and robots.txt
                sfmatthews
                sfmatthews
                0
                4
                714

              • Photogallery and Robots.txt
                Rapturecamps
                Rapturecamps
                0
                5
                831

              • The SEOmoz crawler is being blocked by robots.txt need help
                KeriMorgret
                KeriMorgret
                0
                7
                1.1k

              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