Title: Plugin directory name change error
Last modified: August 21, 2016

---

# Plugin directory name change error

 *  [723media](https://wordpress.org/support/users/723media/)
 * (@723media)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/plugin-directory-name-change-error/)
 * If you change the name of the plugin directory, for example to add the version,
   you get the WordPress error “You do not have sufficient permissions to access
   this page.”
 * This is because the plugin directory is hard coded in all of the links to upload
   media.
 * It should be replaced with something like the following:
 *     ```
       $plugin_dir = basename(plugin_dir_path(__FILE__));
         upload.php?page=$plugin_dir/...
       ```
   
 * [http://wordpress.org/plugins/enable-media-replace/](http://wordpress.org/plugins/enable-media-replace/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Kate](https://wordpress.org/support/users/kate515/)
 * (@kate515)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-directory-name-change-error/#post-4384143)
 * I think I’m encountering this issue. We put our /uploads/ in a separate area 
   on server and define ‘WP_CONTENT_DIR’ and ‘PLUGINDIR.’ I’m pretty sure the plugin
   used to work with this config but now it does not replace old links or have the
   correct URL for the newly uploaded file. On attachment page file URL shows as:
   [http://sitename.com/wp-content/uploads/my-full-defined-file-path/uploads/2013/11/file.jpg](http://sitename.com/wp-content/uploads/my-full-defined-file-path/uploads/2013/11/file.jpg)
   
   rather than what they should [http://sitename.com/wp-content/uploads/2013/11/file.jpg](http://sitename.com/wp-content/uploads/2013/11/file.jpg)
   and it didn’t seem to update the URL to the old media or remove it from the file
   system. The actual file uploads to the correct location but the reference to 
   it is off.
 *  [Kate](https://wordpress.org/support/users/kate515/)
 * (@kate515)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-directory-name-change-error/#post-4384144)
 * **Update:** must be different issue, b/c changing the way I defined my plugin
   location fixed this. Thanks!
 *  [Destillator](https://wordpress.org/support/users/destillator/)
 * (@destillator)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-directory-name-change-error/#post-4384149)
 * I had the same issue, this occured with a renamed wp-content folder. Setting 
   the following in wp-config.php solved this:
 *     ```
       define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' );
       define( 'WP_PLUGIN_URL', 'http://www.yoursite.com/path/to/plugins' );
       ```
   
 * _WP\_PLUGIN\_DIR is the path relative to wp-config’s location and WP\_PLUGIN\
   _URL is the full URL of the directory’s location on the server, including “[http://&#8221](http://&#8221);._

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin directory name change error’ is closed to new replies.

 * ![](https://ps.w.org/enable-media-replace/assets/icon-256x256.png?rev=1940728)
 * [Enable Media Replace](https://wordpress.org/plugins/enable-media-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-media-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-media-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-media-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-media-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-media-replace/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Destillator](https://wordpress.org/support/users/destillator/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-directory-name-change-error/#post-4384149)
 * Status: not resolved