Prevent entire folder from being indexed

#89983
  • Resolved Martin Fisher
    Rank Math pro

    My hosting company use a staging process which creates a copy of the site INSIDE the main folder. This had lead to Rankmath scanning it and including it in the site map which has, of course, created a massive amount of duplicate content errors.

    I can obviously exclude it from the Google site tools but is there a way to stop it being indexed in the first place by RankMath? I understand how to exclude a page or a post but not an entire folder

    Many thanks
    Martin

Viewing 1 replies (of 1 total)
  • Sajid Khan
    Rank Math business

    Hello,

    Thank you for contacting Rank Math today.

    As i can understand, you want to prevent the directory being indexed, the robots.txt standard is meant for this.

    Use the below code.

    User-agent: *
    Disallow: /staging/
    

    You can add this code from here:
    Dashboard > Rank Math > General Settings > Edit robots.txt

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Prevent entire folder from being indexed’ is closed to new replies.