0

I have moved the 'wp-content' directory to a new folder following the guide at Moving Wp-content. I could able to access plugins directory with out any problem as I used the wp_content_dir in addition with WP_CONTENT_DIR' . But I could not able to access themes and unable to install new themes using theme repository.

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' );  
define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');


define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://example/blog/wp-content/plugins');

Edited the wp-config.php with these constraints

Does any one have idea on resolving the issue? I mean, how to access the themes? Also should I expect any trouble in the future for moving the wp-content?

Thank you!

7
  • I never get it to successfully install either. So what I usually do is, install wordpress, edit wp-config, and alter wp-content
    – Sean Lee
    Aug 14, 2011 at 10:05
  • Can you please elaborate, what do you mean by Alteration of wp-content? I can see that you asked similar question and @rarst answered you with a function -register_theme_directory() . Could you help me more about it if that worked for you? Thanks !
    – user3477
    Aug 15, 2011 at 13:24
  • Just re-read your question above. Is your intent to move wp-content into a subdirectory, not on the same level as wp-admin and wp-includes? Or all your wp files are situated under blog?
    – Sean Lee
    Aug 15, 2011 at 15:39
  • I don't have any objection if it is at same level as wp-admin or elsewhere. So, the folder should be like ...public_html/new-custom-folder/site-content' instead of public_html/wp-content
    – user3477
    Aug 16, 2011 at 15:27
  • If all you need is to move wordpress below public_html, then just do so. Create a subdirectory under public_html, then place all wordpress files inside, and install it from there. What else do you need?
    – Sean Lee
    Aug 16, 2011 at 18:09

1 Answer 1

1

Did you set these constants in wp-config.php? Btw. the plugin constants are optional.

On my development instance, I've set the following before ABSPATH and it works without any problems:

define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/blog/wp-content');

Limiations:

a) If you use SSL, you should also check for the rigth protocol with is_ssl(). b) Not every plugin in the repository is using these constants. Many plugins out there has hardcoded paths relative to the root directory. So you could run in some problems if you really need a thirtparty plugin.

1
  • Roman, Thanks for your kind response ! I am not using SSL
    – user3477
    Aug 14, 2011 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.