Title: Plugin Path
Last modified: August 18, 2016

---

# Plugin Path

 *  [davosian](https://wordpress.org/support/users/davosian/)
 * (@davosian)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/plugin-path/)
 * I would like to embed an image in my plugin (widget). The image resides in the
   plugin folder (wp-content/plugins/myplugin/image.gif). How can I reference the
   image from within my plugin without hardcoding the path?
 * Is there something like `get_plugin_directory()`?
 * Thank you,
    Dennis

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/plugin-path/#post-499960)
 * Typical ways to accomplish this:
 * `ABSPATH . 'wp-content/plugins/``_myplugin/image.gif_``'`
 * ABSPATH is a WP constant that provides the full _directory_ path to the (WordPress)
   installation directory.
 * For providing the url, you could use:
 * `get_settings('siteurl') . '/wp-content/plugins/``_myplugin/image.gif_``'`
 *  [iamfletch](https://wordpress.org/support/users/iamfletch/)
 * (@iamfletch)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/plugin-path/#post-500102)
 * i did this 🙂
    `define('PLUGINPATH', ABSPATH.'wp-content/plugins/myplugin');`
 * and this,
 * `define('PLUGINLINK', get_settings('siteurl') . 'wp-content/plugins/wpajax/');`

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

The topic ‘Plugin Path’ is closed to new replies.

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [iamfletch](https://wordpress.org/support/users/iamfletch/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/plugin-path/#post-500102)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
