WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google XML Sitemaps] How to Disallow sub-directory? (6 posts)

  1. s_net
    Member
    Posted 4 years ago #

    I installed WordPress in the root directory and have a sub-directory (i.e., /donotindex/) that I want to Disallow in a robots.txt file. When I look at this plugin (XML sitemaps) it says...

    The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the blog directory!

    So how do I dissallow a subdirectory?

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  2. Dr Madvibe
    Member
    Posted 4 years ago #

    I would also like to know.

    In Settings > XML-Sitemap there is a checkbox:

    Add sitemap URL to the virtual robots.txt file.
    The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the blog directory!

    If it's virtual how do you edit configs you want to make?

    FYI There's no sign of any file anywhere which I'm not too surprised about if it's virtual.

    Also FYI My site is in a directory (not root) if that's any use and I don't have an existing robots.txt file.

    cheers
    Dr M

  3. Drawer
    Member
    Posted 3 years ago #

    Same with me. I want to disallow images.

  4. Darrell Schauss
    Member
    Posted 3 years ago #

    Then create a real robots.txt file in root and manually put in the Sitemap information and turn off the XML Sitemap option for using vitual.
    You should also be aware of any other plugins you are using that edit virtual robots and manually put in those items. Also the Settings -> Privacy "Private, allow regular users, block bots" option uses virtual and should be turned off. Otherwise you would put Disallow: / to block all manually.

    User-agent:*
    Disallow: /directory/
    Sitemap: http://www.yoursite.com/sitemap.xml
  5. Drawer
    Member
    Posted 3 years ago #

    Thank you, darrellonsite! I had done that, but great to get confirmation.

    I also put /images/ instead of directory - not sure what directory means. Also, to help someone else, I read somewhere that it's best to have a line space between the directions (disallow, etc), and the sitemap line, so I did that.

    Let's see how many images Google can take from me now...

  6. Darrell Schauss
    Member
    Posted 3 years ago #

    /directory/ doesnt mean anything. Just a placeholder as example.

Topic Closed

This topic has been closed to new replies.

About this Topic