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. No-index all the posts of a category

    No-index all the posts of a category

    On-Page / Site Optimization
    5 2 2.1k
    • 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.
    • salvyy
      salvyy last edited by

      Hi everyone!

      I would like no-indexing all the posts of a specific category of my wordpress site.

      The problem is that the structure of my URL is composed without /category/: www.site-name.ext/date/post-name/
      so without /category-name/

      Is possibile to disallow the indexing of all the posts of the category via robots.txt?

      Using Yoast Plugin I can put the no-index for each post, but I would like to put the no-index (or disallow/) a time for all the post of the category.

      Thanks in advance for your help and sorry for my english.

      • Mike
      1 Reply Last reply Reply Quote 0
      • OlegKorneitchouk
        OlegKorneitchouk last edited by

        Wordpress Admin > Posts > Categories > Edit the category you want to noindex > Set "always noindex" for "Noindex this category" box

        EDIT: looks like that just noindexes the actual category page.

        Here is a workaround I found...

        1. Find the category ID (WP Admin > Posts > Categories > Edit the category you want to noindex > look at URL for the tag_ID # (this is the category ID))

        2. Edit your theme header and include:

        <?php if (is_single() && in_category(array(###)))  { 
        echo '';
        } ?>
        

        where ### is the category ID

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

          Hi Oleg, thanks for your help.

          I did just some tests and does it seems to work fine.

          Do you think is possible to block Google bot to indexing all the post of a category?in this way (disallow/ in the robots.txt) I could save the Google crawle budget for the pages of my site that I want to index.

          Thanks a lot for your help Oleg.

          Have a nice weekend,- Mike

          OlegKorneitchouk 1 Reply Last reply Reply Quote 0
          • OlegKorneitchouk
            OlegKorneitchouk @salvyy last edited by

            With that code, Google won't index any pages within that particular category.

            Unfortunately, without a specific folder pattern, you cannot block via robots.txt

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

              Sure, without /category/ in the URL structure I can't block Googlebot using the robots.txt

              No problem, now I can use the noindex for all the posts.

              Thank you so much Oleg.

              Regards,

              • MIke
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Do product sub-categories compete with top level categories for rankings?
                GastonRiera
                GastonRiera
                0
                2
                50

              • One post on a keyword updated frequently vs. multiple posts
                EricOliver
                EricOliver
                0
                6
                156

              • No index?
                mad2k
                mad2k
                0
                3
                289

              • How to properly remove pages and a category from Google's index
                VinceWicks
                VinceWicks
                0
                5
                324

              • ON SITE SEARCH INDEXED BY GOOGLE - no follow or no index
                ShaMenz
                ShaMenz
                0
                4
                770

              • Wordpress: Should I NO INDEX Categories & Archives Pages?
                brightvessel
                brightvessel
                1
                8
                31.2k

              • Tags to index or to no index that is the Question
                blu42media
                blu42media
                0
                3
                702

              • Category Pages with Sub-Categories
                drewschmaltz
                drewschmaltz
                0
                5
                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