6

Currently my plugins are getting uploaded to public_html/sitename/wp-content/plugins instead of public_html/wp-content/plugins. Is there any way that I can change the path where word press uploads the plugins?

I had moved my site to the root folder and hence this issue arose.

3
  • How did you move your site? If you did that properly, WordPress should have updated filepaths on its own. Dec 4, 2012 at 17:14
  • I used back up buddy. As it stands now, any plugin that I upload gets uploaded to public_html/oldsite/wp-content/plugins instead of public_html/wp-content/plugins. I even tried uploading the plugin manually to public_html/wp-content/plugins. However, plugin page does not detect it and so I am unable to install it. Any help will be appreciated.
    – user544079
    Dec 4, 2012 at 17:20
  • Go to Dashboard -> Settings -> General. What are the URLs for WordPress Address (URL) and Site Address (URL)? Dec 4, 2012 at 17:29

1 Answer 1

15

You can change the Plugins directory using constants defined in wp-config.php:

Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g.

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

Set WP_CONTENT_URL to the full URI of this directory (no trailing slash), e.g.

define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');

Set WP_PLUGIN_DIR to the full local path of this directory (no trailing slash), e.g.

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

Set WP_PLUGIN_URL to the full URI of this directory (no trailing slash), e.g.

define( 'WP_PLUGIN_URL', 'http://example/blog/wp-content/plugins');

If you have compability issues with plugins Set PLUGINDIR to the full local path of this directory (no trailing slash), e.g.

define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins' );

But wait!

If the need to define these paths originates from moving your installation from a subdirectory to the document root, your problem is very likely that you didn't make that move properly. Please reference this Codex entry about giving WordPress its own directory.

4
  • I added the lines define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' ); define( 'WP_CONTENT_URL', 'example/blog/wp-content'); in my wp-config.php and then removed it. But my site has now broken. PLEASE HELP
    – user544079
    Dec 4, 2012 at 17:44
  • None of the plugins show up on the site
    – user544079
    Dec 4, 2012 at 17:44
  • Try adding http:// to the start of WP_CONTENT_URL: define( 'WP_CONTENT_URL', 'http://example/blog/wp-content';);
    – shea
    Dec 4, 2012 at 19:22
  • now link to WP docs is: wordpress.org/support/article/…
    – ingconti
    Oct 24, 2020 at 5:59

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.