WordPress.org

Ready to get started?Download WordPress

Forums

Why is Google Indexing This??? (11 posts)

  1. pgale
    Member
    Posted 7 years ago #

    I just did a site check and google is indexing my wp-content/plugins folder

    I didn't see any other folder being indexed except this one.

    I've had WP blogs before and have never seen this. What could be the cause? I definitely don't need this folder exposed.

  2. Jonathan Landrum
    Member
    Posted 7 years ago #

    chmod 750 or something. Or put in a blank index.

  3. pgale
    Member
    Posted 7 years ago #

    The blank index.php is there in the wp-content folder, so it does not prevent Google from indexing this folder. This is the NewsPortal theme and the latest update of WordPress.

    I have an older version of WP using the Fleur theme and this is not an issue.

    I will try to CMOD 750. Is anyone else having this issue?

  4. Jonathan Landrum
    Member
    Posted 7 years ago #

    I've only had the issue of Google indexing plugins which post their files to the site, like a translator plugin I was using once. All of the flags and the javascript from that plugin are indexed, so when I quit using it I had to redirect gone in .htaccess.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    What Google sees, anybody can see. So I would recommend disabling directory browsing for folders on your site.

    Add this line to the top of your .htaccess file (in the blog root will be fine):
    Options -Indexes

  6. pgale
    Member
    Posted 7 years ago #

    Otto42, that worked perfectly! I added that line to my .htaccess file and it worked like a charm.

    Thank you very much. Now there is a "Forbidden" message when trying to get to those folders.

    I truly appreciate your help.

  7. maerk
    Member
    Posted 7 years ago #

    FYI: CHMOD won't help here. CHMOD is something the server uses to control who can and cannot access files on the server itself -- i.e. which users on the server. Outside of the server, it has no effect whatsoever.

    Setting Options -Indexes only prevents the server from listing directories' contents. Files, for instance wp-content/plugins/plugin-file.php (that's made up) will still be accessible, and if Google could access it before, it'll still be able to access it now.

    Another thing you may want to look into is robots.txt. This tells search engines what you do and don't want to be included in their indexes.

    More info: http://www.robotstxt.org/

    Bear in mind that this is accessible to anyone. Check it out:
    http://google.com/robots.txt
    http://www.microsoft.com/robots.txt

    All the major search engines read this file and respect it.

    I would recommend, for you, something like:

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

    This tells all search engines to leave those directories alone.

    Incidentally, I recommend these lines, too:

    User-Agent: ia_archiver
    Disallow: /

    This stops your site being archived in the Wayback Machine project.

  8. OperaManiac
    Member
    Posted 7 years ago #

    User-agent: *
    Disallow: */feed*
    Disallow: */trackback
    Disallow: */wp-admin
    Disallow: */wp-content
    Disallow: */wp-includes
    Disallow: *wp-login.php

    this would prevent indexing of other non relevant content!

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    If you disallow access to wp-content, then any images you upload won't be indexed. This may or may not be what you want.

    Also, disallowing access to your feeds is very silly, since you definitely want them to index your feeds. Google understands feeds.

    Options -Indexes is enough for most people. Unless you're directly linking to your plugins, it won't matter anyway. Your plugin files will *not* be accessible, because plugins are PHP files, and PHP files *run* on the webserver, and 99% of plugins don't do anything at all when you run them like that, or they fail to work, or what have you.

  10. maerk
    Member
    Posted 7 years ago #

    Otto42: You're right about the PHP files, of course. Trying to load certain wordpress PHP files will just generate an error message.

    BUT error messages often contain server information. You probably don't want these to be indexed. For instance, if you call a plugin file directly without WordPress being loaded, PHP will usually insert an error message that contains the server path to the script. That's probably not desirable, since server paths often contain information like usernames.

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    maerk: Add this to your .htaccess file (or just edit the php.ini to turn off error reporting).

    php_flag display_errors off
    php_value error_reporting 0

Topic Closed

This topic has been closed to new replies.

About this Topic