Title: WordPress content directory changed
Last modified: September 1, 2016

---

# WordPress content directory changed

 *  [deepesh](https://wordpress.org/support/users/deepesh/)
 * (@deepesh)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/)
 * Hi,
 * We have changed the wordpress content directory ‘wp-content’ to a different name
   for a client request
    but the code you wrote is specifically works for wp-content
   as content directory which i felt is a major problem when we change the content
   directory path Can you check and fix in this next version. I appreciate the plugin
   and it is very good but this kind of things should be manageable
 * <?php
    // load wp core $path = explode( ‘wp-content’, __FILE__ ); include_once(
   reset( $path ) . ‘wp-load.php’ );
 * da_download_attachment( isset( $_GET[‘id’] ) ? (int) $_GET[‘id’] : 0 );
 * [https://wordpress.org/plugins/download-attachments/](https://wordpress.org/plugins/download-attachments/)

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

 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/#post-7717638)
 * Hi,
 * This is something you should NEVER change- if you did that, it’s on your own 
   risk.
 * What is managable and can be changed is WP uploads folder and this plugin handles
   that automatically.
 * Regards,
    Bartosz / dfactory team
 *  Thread Starter [deepesh](https://wordpress.org/support/users/deepesh/)
 * (@deepesh)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/#post-7717644)
 * [https://premium.wpmudev.org/blog/10-wp-config-tweaks-to-improve-your-wordpress-site/](https://premium.wpmudev.org/blog/10-wp-config-tweaks-to-improve-your-wordpress-site/)
 * Please read this
 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/#post-7717662)
 * Ok, point for you : ) (even though i personally wouldn’t recomment this)
 * Regarding the issue – you can’t manage that as at that point there is no WP loaded,
   no constants, globals, filters or functions available
 * What if you make a change in plugin file includes/download.php, from this:
 *     ```
       $path = explode( 'wp-content', __FILE__ );
       include_once( reset( $path ) . 'wp-load.php' );
       ```
   
 * to this:
 *     ```
       $path = explode( 'wp-content', __FILE__ );
   
       if ( is_file( reset( $path ) . 'wp-load.php' ) ) {
       	include_once( reset( $path ) . 'wp-load.php' );
       } else {
       	$path = explode( '/', $_SERVER['REQUEST_URI'] );
       	include_once( $_SERVER['DOCUMENT_ROOT'] . '/' . $path[1] . '/wp-load.php' );
       }
       ```
   
 * It’s not very elegant but should work.
 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/#post-7717664)
 * If I knew you did that: [https://wordpress.org/support/topic/poorly-managing-the-wordpress-content-directory?replies=1#post-8821859](https://wordpress.org/support/topic/poorly-managing-the-wordpress-content-directory?replies=1#post-8821859)
   I wouldn’t reply to you.

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

The topic ‘WordPress content directory changed’ is closed to new replies.

 * ![](https://ps.w.org/download-attachments/assets/icon-256x256.png?rev=1018456)
 * [Download Attachments](https://wordpress.org/plugins/download-attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/download-attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/download-attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/download-attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/download-attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/download-attachments/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [dFactory](https://wordpress.org/support/users/dfactory/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-content-directory-changed/#post-7717664)
 * Status: not resolved