WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a script that uploads a file to a specific folder in the wordpress installation.

Basically I want to upload to /uploads. However, in order to do this I need to know the server path for the WordPress installation.

How can I get this?

share|improve this question
Related: wordpress.stackexchange.com/questions/12339/… – hakre Jul 8 '11 at 15:19
up vote 4 down vote accepted

Use wp_upload_dir() for path to uploads, and use get_bloginfo() to get paths to the WP location

share|improve this answer
aha! brilliant, thank you. – Thomas Clayson Jul 8 '11 at 15:06

You can retrieve the path where Wordpress has been installed to from the ABSPATH constant.

It should be available in your plugin/theme code, it is defined at the very start of wp-load.php.

See also: Using the ABSPATH constant - What files need to be loaded before use?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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