{"id":1119,"date":"2019-08-15T13:56:19","date_gmt":"2019-08-15T05:56:19","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=1119"},"modified":"2019-08-15T13:56:22","modified_gmt":"2019-08-15T05:56:22","slug":"define-upload-path-wordpress","status":"publish","type":"post","link":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/","title":{"rendered":"How to Define the Upload Path in WordPress"},"content":{"rendered":"\n

Most of the time, you don't have to worry about the upload path in WordPress. It's just handled automatically with a fallback.<\/p>\n\n\n\n

A plugin on a site I was working on had a problem with wp_upload_dir()<\/em>, which is supposed to fetch the location of the uploads. It resulted in the error you see in the picture above.<\/p>\n\n\n\n

Error: Your upload path is not valid or does not exist: C:\\xampp\\htdocs\\abf\/C:\/xampp\/htdocs\/abf\/wp-content\/uploads<\/code><\/pre>\n\n\n\n

Thankfully, the solution was very simple.<\/p>\n\n\n\n

How to define the upload path in WordPress<\/strong>:<\/p>\n\n\n\n

  1. Open wp_config.php<\/em> in your preferred text editor<\/li>
  2. Add this line below the WP_DEBUG line:
    define('UPLOADS', 'wp-content\/uploads');<\/li>
  3. Save wp_config.php<\/em><\/li><\/ol>\n\n\n\n

    If you have a custom upload folder, change 'wp-content\/uploads'<\/em> to that location.<\/p>\n\n\n\n

    You can also use this function to set a custom directory for uploading your images and other WordPress media files.<\/p>\n","protected":false},"excerpt":{"rendered":"

    Most of the time, you don’t have to worry about the upload path in WordPress. It’s just handled automatically with a fallback. A plugin on a site I was working on had a problem with wp_upload_dir(), which is supposed to fetch the location of the uploads. It resulted in the error you see in the<\/p>\n","protected":false},"author":2,"featured_media":1120,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"yoast_head":"\nHow to Define the Upload Path in WordPress<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Define the Upload Path in WordPress\" \/>\n<meta property=\"og:description\" content=\"Most of the time, you don't have to worry about the upload path in WordPress. It's just handled automatically with a fallback. A plugin on a site I was working on had a problem with wp_upload_dir(), which is supposed to fetch the location of the uploads. It resulted in the error you see in the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Intelliwolf\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-15T05:56:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-15T05:56:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mike Haydon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Haydon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\"},\"author\":{\"name\":\"Mike Haydon\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\"},\"headline\":\"How to Define the Upload Path in WordPress\",\"datePublished\":\"2019-08-15T05:56:19+00:00\",\"dateModified\":\"2019-08-15T05:56:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\"},\"wordCount\":139,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png\",\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\",\"url\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\",\"name\":\"How to Define the Upload Path in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png\",\"datePublished\":\"2019-08-15T05:56:19+00:00\",\"dateModified\":\"2019-08-15T05:56:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage\",\"url\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png\",\"contentUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png\",\"width\":1280,\"height\":720,\"caption\":\"Define the upload path in WordPress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.intelliwolf.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/www.intelliwolf.com\/category\/general\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Define the Upload Path in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.intelliwolf.com\/#website\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"name\":\"Intelliwolf\",\"description\":\"WordPress, Web Design & Coding Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.intelliwolf.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\",\"name\":\"Intelliwolf\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"contentUrl\":\"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"width\":300,\"height\":100,\"caption\":\"Intelliwolf\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\",\"name\":\"Mike Haydon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"caption\":\"Mike Haydon\"},\"sameAs\":[\"https:\/\/intelliwolf.com\/about-mike-haydon\/\"]}]}<\/script>\n","yoast_head_json":{"title":"How to Define the Upload Path in WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Define the Upload Path in WordPress","og_description":"Most of the time, you don't have to worry about the upload path in WordPress. It's just handled automatically with a fallback. A plugin on a site I was working on had a problem with wp_upload_dir(), which is supposed to fetch the location of the uploads. It resulted in the error you see in the","og_url":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/","og_site_name":"Intelliwolf","article_published_time":"2019-08-15T05:56:19+00:00","article_modified_time":"2019-08-15T05:56:22+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png","type":"image\/png"}],"author":"Mike Haydon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mike Haydon","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/"},"author":{"name":"Mike Haydon","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343"},"headline":"How to Define the Upload Path in WordPress","datePublished":"2019-08-15T05:56:19+00:00","dateModified":"2019-08-15T05:56:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/"},"wordCount":139,"commentCount":1,"publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"image":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png","articleSection":["General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/","url":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/","name":"How to Define the Upload Path in WordPress","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png","datePublished":"2019-08-15T05:56:19+00:00","dateModified":"2019-08-15T05:56:22+00:00","breadcrumb":{"@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#primaryimage","url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png","contentUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/2019\/08\/2019-08-15_define-upload-path-wordpress.png","width":1280,"height":720,"caption":"Define the upload path in WordPress"},{"@type":"BreadcrumbList","@id":"https:\/\/www.intelliwolf.com\/define-upload-path-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.intelliwolf.com\/"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/www.intelliwolf.com\/category\/general\/"},{"@type":"ListItem","position":3,"name":"How to Define the Upload Path in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.intelliwolf.com\/#website","url":"https:\/\/www.intelliwolf.com\/","name":"Intelliwolf","description":"WordPress, Web Design & Coding Tutorials","publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.intelliwolf.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.intelliwolf.com\/#organization","name":"Intelliwolf","url":"https:\/\/www.intelliwolf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","contentUrl":"https:\/\/www.intelliwolf.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","width":300,"height":100,"caption":"Intelliwolf"},"image":{"@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343","name":"Mike Haydon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","caption":"Mike Haydon"},"sameAs":["https:\/\/intelliwolf.com\/about-mike-haydon\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts\/1119"}],"collection":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":0,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/posts\/1119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/media\/1120"}],"wp:attachment":[{"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.intelliwolf.com\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}