1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How Do i Hide My plugins?

Discussion in 'Blogging' started by porko, May 13, 2009.

  1. porko

    porko Registered Member

    Joined:
    May 25, 2008
    Messages:
    61
    Likes Received:
    19
    Location:
    The Scary Place Down The Street
    Home Page:
    Can anyone tell me how to hide My Wordpress plugins form the search engines,do i make an htaccess file? What do i nedd to put in it?

    Thanks:)
     
  2. neo

    neo Power Member

    Joined:
    May 5, 2007
    Messages:
    500
    Likes Received:
    365
    Use your robots.txt to disallow the plugins folder.

    Upload a blank file called index.html to your wp-content/plugins folder.
     
  3. greyhatdude

    greyhatdude Regular Member

    Joined:
    Sep 13, 2008
    Messages:
    377
    Likes Received:
    255
    Occupation:
    Medical Field
    Location:
    Philippines, here I come.
    Home Page:
    Create a .htaccess file in wp-content/plugins. Open a new plain text file. Paste this into it and save it as .htaccess

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # Prevents directory listing
    Options -Indexes
    # END WordPress

    then upload it to your server as a plain text (ASCII) file
     
    • Thanks Thanks x 1
  4. qazxsw11111

    qazxsw11111 Newbie

    Joined:
    Sep 29, 2008
    Messages:
    17
    Likes Received:
    1
    Hmm, I did as above ^^^^. But it still doesnt seem to hide it.... Do I need to replace anything in the code or edit it? I saved it as .htaccess in notepad but i still can see the folder.
     
  5. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    I just stick an index.php file in there with a redirect to the main index page.
     
  6. jpopmonster

    jpopmonster Newbie

    Joined:
    Feb 17, 2009
    Messages:
    43
    Likes Received:
    3
    Occupation:
    JWP? (Job? What Job?)
    Location:
    Under your bed
    Could you elaborate more? How can I redirect the index.php file to the main index page?
     
  7. otto14

    otto14 Jr. VIP Jr. VIP

    Joined:
    Dec 16, 2008
    Messages:
    376
    Likes Received:
    152
    Just put that code in your htaccess

    HTML:
    # Prevents directory listing
    Options -Indexes
    
     
  8. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    In the plugin directory I have:

    PHP:
    <?php 
       header
    ("HTTP/1.1 301 Moved Permanently");
       
    header("Location: http://domain.com/);
       header("
    Connectionclose");
    ?>
    Hope that helps
     
  9. Mudvaine

    Mudvaine Registered Member

    Joined:
    Apr 6, 2008
    Messages:
    64
    Likes Received:
    79
    Location:
    Disney World
    There is a wordpress plugin called wp-tweaks and it actually has an option to hide your plugin folders. Works great on my blogs.

    Hope this helps. :)
     
    • Thanks Thanks x 1
  10. sikx

    sikx Registered Member

    Joined:
    Jan 4, 2009
    Messages:
    65
    Likes Received:
    166
    Location:
    Germany
    Home Page:
    I wouldnt only try to stop it from getting indexed, but also prevent it from getting 'brute-forced' (just trying out plugin-names). Thus your best bet will be with mod_rewrite.
     
  11. dumdumz

    dumdumz Registered Member

    Joined:
    Jan 5, 2009
    Messages:
    50
    Likes Received:
    6
    If you use the htaccess code suggested above, that will fix it but will give a 403 error. I personally would use mod_rewrite to just redirect them to the home page.

    If you are trying to keep plugin files from being called directly, then you will need to edit your plugin files. At the top of the plugin file you can check for a wordpress constant or function such as if(isset(ABSPATH)) or if(function_exists('get_option')) to see if the file is being called from wordpress or being called directly then redirect or throw error message as appropriate.
     
  12. greyhatdude

    greyhatdude Regular Member

    Joined:
    Sep 13, 2008
    Messages:
    377
    Likes Received:
    255
    Occupation:
    Medical Field
    Location:
    Philippines, here I come.
    Home Page:
    You could also just add "Options All -Indexes" to your .htaccess
    (Edit: Sorry, didn't see that Otto14 already posted that.)

    You could also do whatever you want with wp-content/plugins/index.html.
    Goatse, anyone?
     
    Last edited: May 14, 2009
  13. greyhatdude

    greyhatdude Regular Member

    Joined:
    Sep 13, 2008
    Messages:
    377
    Likes Received:
    255
    Occupation:
    Medical Field
    Location:
    Philippines, here I come.
    Home Page:
    How to create a custom 403 with mod_rewrite (I've never tried this myself):

    williamfaulkner.co.uk/wordpress/2008/06/custom-403-and-404-pages-with-wordpress/
     
  14. godmonkee

    godmonkee Regular Member

    Joined:
    Jan 12, 2009
    Messages:
    396
    Likes Received:
    766
    Occupation:
    IM
    Location:
    Gallifrey
    So I just uploaded this plug-in to my blog and activated it and now all my plug ins are hidden. well worth a try.
     
  15. iglow

    iglow Elite Member

    Joined:
    Feb 20, 2009
    Messages:
    2,081
    Likes Received:
    856
    Home Page:
    Put index.html in folders..