I'm using mac os x 10.6 with xampp.

http://wp3.1/ is the url to where I have WordPress installed.

The physical path is /Users/myUserName/Sites/wp3.1/

I do not install plugins or themes in the "natural" way. I have created a directory named "git" which is located in /Users/myUserName/git/. This is where all my git repositories live. When I want to install a plugin, I just create a symbolic link in /Users/myUserName/Sites/wp3.1/wp-content/plugins/. This works great for simple plugins, but if the plugin enqueue's a style sheet or script, the url displays as:


How do I fix this?

2 Answers 2


Symbolic links are … risky in WordPress. It is easier to use a separate domain for plugins per wp-config.php:

define( 'WP_PLUGIN_DIR', '/local/path/to/plugin/directory' );
define( 'WP_PLUGIN_URL', 'http://plugins.dev');

See Strategy On Building Plugin Using Eclipse as an example for IDE configuration with such a setup.

  • Interesting ... Thanks! Going to give this a try right away.
    – mfields
    Commented Apr 24, 2011 at 0:53
  • This worked liked a charm. Thanks so much! It took me a while to get my vhosts set up, but now everythings working perfectly. Mad Props!!!
    – mfields
    Commented Apr 24, 2011 at 1:35
  • @toscho: Won't using a separate domain for your plugins create issues with cross-domain security in browsers? WP Cookies that are not transferred when you access something in `plugins.dev/myplugin/myaction.php'?
    – Jan Fabry
    Commented Apr 27, 2011 at 11:26
  • 1
    @Jan Fabry I'm using this method for development only. IMO, plugins coded to access their files are doing it wrong. Actions such as this should be handled by admin-ajax.php.
    – mfields
    Commented Apr 29, 2011 at 14:21
  • 1
    +1 This is possible for Plugins as well as MU-Plugins, but sadly not for Dropins, which have to stay in your ~/wp-content dir...
    – kaiser
    Commented Jun 26, 2012 at 13:46

As you can see, the plugin URL is correct except for the real path stuck in the middle. We can filter the function responsible for generating plugin URLs and remove this.

The following code should be installed as a Must Use Plugin:

add_filter( 'plugins_url', function( $url ) {
    return str_replace( '/Users/myUserName/git/', '', $url );

Your Answer

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

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