WordPress.org

Ready to get started?Download WordPress

Forums

Stop Google indexing my plugins and other pages? (3 posts)

  1. jf80
    Member
    Posted 5 years ago #

    I did a site:mysite.com and saw that Google has indexed lots of strange pages and files. They look like they are my plug in and theme files.

    Is there a way to rectify this and if so how?

    Will this suffice:

    Disallow: wp-admin/
    Disallow: wp-content/plugins/
    Disallow: wp-content/themes/

    Thanks.

  2. elizabethrichardson
    Member
    Posted 4 years ago #

    I'd really like to know the answer to this question as well.

    What do we add to our robots.txt file to allow the search engines to index our content but not the plugins and themes?

  3. alism
    Member
    Posted 4 years ago #

    jf80 (if you're still looking for an answer!), yes, the way with robots.txt that you suggest should work...

    All search engines:

    User-agent: *
    Disallow: /wp-content/themes/plugins/
    Disallow: /wp-content/themes/yourtheme/
    Disallow: /wp-admin/
    Disallow: /wp-includes/

    Just add in any directories you don't want indexed.

    I'd also suggest putting a blank index file in any directories, just to hide the directory contents.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.