Title: Woocommerce css has hard coded /plugins/ path
Last modified: September 24, 2020

---

# Woocommerce css has hard coded /plugins/ path

 *  Resolved [imcobarn](https://wordpress.org/support/users/imcobarn/)
 * (@imcobarn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/)
 * I’m using “define( ‘WP_PLUGIN_DIR'” and define( ‘WP_PLUGIN_URL’,” in wp-config
   
   Noticing that woocommerce font is not loading as it is still looking into “/plugins/”
   directory Also Woocommerce css has hard coded /plugins/ path in it.
 * How to fix this?

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

 *  Plugin Support [slash1andy](https://wordpress.org/support/users/slash1andy/)
 * (@slash1andy)
 * Automattic Happiness Engineer
 * [5 years, 8 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13451950)
 * Hey there!
 * This is not what we would expect to see with the release build from WordPress.
   org.
 * Can you please elaborate on where you are seeing this path?
 *  Thread Starter [imcobarn](https://wordpress.org/support/users/imcobarn/)
 * (@imcobarn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13451968)
 * Hi,
 * Looking in source code via browser developer tools.
    Console shows error “Failed
   to load resource: the server responded with a status of 404 (Not Found) – WooCommerce.
   woff:1 ”
 * Then in “sources” tab looking at woocommerce.min.css shows this:
    “@charset “
   UTF-8″;@keyframes spin{100%{transform:rotate(360deg)}}@font-face{font-family:
   star;src:url(../../../../../../../plugins/woocommerce/assets/fonts/star.eot);”
 * Just looked at the css file itself and it is not hard coded but it is like this:
   “
   @font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.
   eot?#iefix) format(“embedded-opentype”),url(../fonts/star.woff)”
 * So src:url(../fonts looks in /plugins/fonts directory and ignores constants defined
   in wp-config I guess?
 * In Firefox I get “downloadable font: download failed (font-family: “WooCommerce”
   style:normal weight:400 stretch:100 src index:1): status=2147746065 source: [https://mywebsite.com/](https://mywebsite.com/)**
   custom-content**/plugins/woocommerce/assets/fonts/WooCommerce.woff”
    It is interesting
   as I also use “WP_CONTENT_URL” and “WP_CONTENT_DIR” constant set to “**custom-
   content**” so it recognizes that apparently but not plugins URL/DIR.
 * Thanks.
    -  This reply was modified 5 years, 8 months ago by [imcobarn](https://wordpress.org/support/users/imcobarn/).
 *  [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * (@mikestraw)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13572310)
 * Hi [@imcobarn](https://wordpress.org/support/users/imcobarn/) ,
 * The CSS code can’t read the WordPress variables from the browser, so it does 
   use relative paths to get to the locations it needs.
 * Can you check your Network tab to make sure that fonts folder is loading, even
   if it’s coming into a different path?
 * I also noticed you are setting both the _DIR and _URL constants for content and
   plugins. May I ask what those are set to? I wanted to double check, because of
   this:
 * > I also use “WP_CONTENT_URL” and “WP_CONTENT_DIR” constant set to “custom-content”
   > so it recognizes that apparently but not plugins URL/DIR.
 * I just wanted to confirm that `WP_CONTENT_URL` isn’t set to just `custom-content`
   as [it should be set to the full URL of the content folder with no trailing slash](https://wordpress.org/support/article/editing-wp-config-php/#moving-wp-content-folder).
 * Based on what you’re describing, the constants should be something like this:
 *     ```
       define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/path/to/custom-content' );
       define( 'WP_CONTENT_URL', 'https://mywebsite.com/custom-content' );
       define( 'WP_PLUGIN_DIR', dirname(__FILE__) . 'path/to/your-plugins-folder' );
       define( 'WP_PLUGIN_URL', 'https://mywebsite.com/your-plugins-folder' );
       ```
   
 * Are your constants set this way? If you wouldn’t mind sharing what those are 
   set to, I can try reproducing this locally to track where the issue is occurring.
 * I also noticed that [there is a `PLUGINDIR` option](https://wordpress.org/support/article/editing-wp-config-php/#moving-plugin-folder)
   to handle some compatibility issues. Do you have that constant set? If not, can
   you try setting it to see if it makes a difference? That’ll help see what’s happening,
   as well.
 * Thanks!
 *  Thread Starter [imcobarn](https://wordpress.org/support/users/imcobarn/)
 * (@imcobarn)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13572512)
 * [@mikestraw](https://wordpress.org/support/users/mikestraw/) yes that is exactly
   how they are set:
 *     ```
       define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/core-content' );
       define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/core-content/modules' );
       define( 'WP_CONTENT_URL', 'https://myshop.com/core-content' );
       define( 'WP_PLUGIN_URL',  'https://myshop.com/core-content/modules' );
       ```
   
 * Thanks for looking into this.
 *  [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * (@mikestraw)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13581636)
 * Hi [@imcobarn](https://wordpress.org/support/users/imcobarn/) ,
 * Thanks for that! I was able to reproduce the issue on my own test site and have
   reported it to the developers here: [https://github.com/woocommerce/woocommerce/issues/28097](https://github.com/woocommerce/woocommerce/issues/28097)
 *  [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * (@mikestraw)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13615665)
 * Since this is now being handled within that GitHub issue, I’m going to mark this
   thread as resolved. You can monitor the bug for the latest status.
 * If there’s anything else you need help with, you can open a new thread.

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

The topic ‘Woocommerce css has hard coded /plugins/ path’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Mike Straw](https://wordpress.org/support/users/mikestraw/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/woocommerce-css-has-hard-coded-plugins-path/#post-13615665)
 * Status: resolved