How Do i Hide My plugins?

porko

Registered Member
Joined
May 25, 2008
Messages
61
Reaction score
12
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:)
 
Use your robots.txt to disallow the plugins folder.

Upload a blank file called index.html to your wp-content/plugins folder.
 
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
 
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.
 
I just stick an index.php file in there with a redirect to the main index page.
 
Just put that code in your htaccess

HTML:
# Prevents directory listing
Options -Indexes
 
Could you elaborate more? How can I redirect the index.php file to the main index page?

In the plugin directory I have:

PHP:
<?php 
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: http://domain.com/);
   header("Connection: close");
?>

Hope that helps
 
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. :)
 
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.
 
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.

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.
 
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:
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.

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/
 
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. :)

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.
 
Back
Top