Title: Plugin useless if plugin dir is moved (CSS/JS)
Last modified: March 9, 2022

---

# Plugin useless if plugin dir is moved (CSS/JS)

 *  Resolved [Paderman](https://wordpress.org/support/users/paderman/)
 * (@paderman)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/plugin-useless-if-plugin-dir-is-moved-css-js/)
 * Hello,
 * I moved successful the plugin directory in a other directory and I added in _wp-
   config.php_ following:
 *     ```
       define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/site/plugins' );
       define('WP_PLUGIN_URL', 'https://' . $_SERVER['SERVER_NAME'] . '/wp-content/plugins');
       ```
   
 * All moved plugins was reactivated and _User Role Editor_ is shown too, but CSS
   and JavaScript don’t work like before moving the plugin directory.
    - /wp-admin/users.php?page=users-user-role-editor.php
    - /wp-admin/users.php?page=users-user-role-editor.php&object=user
 * Where is the error of that?
    In the files, I couldn’t find anything, can you 
   help please to solve this problem?
 * Reason to moving the plugin directory is a restrict FTP access of a user within
   wp-content and he doesn’t should be access to the plugin directory 😉
 * Thank you in advance 🙂
 * **Edit:**
    I see, other plugins have same problem with CSS and JavaScript🤔 Files
   CSS/JavaScript were not found, error 404 🤔
    -  This topic was modified 4 years, 2 months ago by [Paderman](https://wordpress.org/support/users/paderman/).
    -  This topic was modified 4 years, 2 months ago by [Paderman](https://wordpress.org/support/users/paderman/).

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

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/plugin-useless-if-plugin-dir-is-moved-css-js/#post-15440518)
 * Hi,
 * Why you have different paths:
    1) ‘/site/plugins’ at plugin absolute path but
   2) ‘/wp-content/plugins’ at plugin URL?
 * Look how plugin builds path to CSS really at the browser page HTML source.
 *  Thread Starter [Paderman](https://wordpress.org/support/users/paderman/)
 * (@paderman)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/plugin-useless-if-plugin-dir-is-moved-css-js/#post-15441544)
 * Hello,
    thank you for your reply.
 * I found the error 🤔 🙈
    Both path must be identically, then it works 🙈
 * `define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/site/plugins' );`
 * `WP_PLUGIN_URL', '//' . $_SERVER['SERVER_NAME'] . '/site/plugins');`
 * It was my mistake 🙈 😬
 * For all user that want move the plugin folder:
 *     ```
       $WP_PLUGIN_NEW_PATH = '/new_folder/plugins';
       define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . $WP_PLUGIN_NEW_PATH );
       define('WP_PLUGIN_URL', '//' . $_SERVER['SERVER_NAME'] . $WP_PLUGIN_NEW_PATH);
       ```
   
 * Note: the double slashes _//_ in WP_PLUGIN_URL stands for _http:_ or _https:_
   😉
    -  This reply was modified 4 years, 2 months ago by [Paderman](https://wordpress.org/support/users/paderman/).

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

The topic ‘Plugin useless if plugin dir is moved (CSS/JS)’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 2 replies
 * 2 participants
 * Last reply from: [Paderman](https://wordpress.org/support/users/paderman/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/plugin-useless-if-plugin-dir-is-moved-css-js/#post-15441544)
 * Status: resolved