{"id":6392,"date":"2017-07-18T14:54:01","date_gmt":"2017-07-18T14:54:01","guid":{"rendered":"http:\/\/amazing-money.flywheelsites.com\/?p=6392\/"},"modified":"2017-07-18T14:54:01","modified_gmt":"2017-07-18T14:54:01","slug":"wordpress-how-to-change-the-default-media-upload-folder","status":"publish","type":"post","link":"https:\/\/beheydt.be\/en\/wordpress-how-to-change-the-default-media-upload-folder\/","title":{"rendered":"WordPress: How to change the default media upload folder"},"content":{"rendered":"<p>If you&#8217;re an avid user of your WordPress blog, you will no doubt have worked with the WordPress Media Uploader before. This is the interface that let&#8217;s you upload media such as movies and images, and it saves them all happily in the &#8216;wp-content\/uploads&#8217; folder<br \/>\nIf you use it alot, or if you are doing some other WordPress magic, you may come to the point that you want to change that folder.<\/p>\n<div id=\"attachment_6393\" style=\"width: 310px\" class=\"wp-caption alignleft\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6393\" class=\"size-medium wp-image-6393\" src=\"https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10-300x300.jpg\" alt=\"Ferris Wheel Reflected In A Puddle\" width=\"300\" height=\"300\" srcset=\"https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10-300x300.jpg 300w, https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10-150x150.jpg 150w, https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10-768x768.jpg 768w, https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10-1024x1024.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-6393\" class=\"wp-caption-text\">Ferris Wheel Reflected In A Puddle<\/p><\/div>\n<p>For instance, in my case, for setting up a dual node wordpress installation, where the uploads folder needs to be shared on a different fileserver (I know, there were other solutions possible too). So, how do you go about then?<br \/>\nFirst of all, a word of advice: this change is not for the faint-hearted, or novices. It involves manually editing the wp-config.php file, and may break your WordPress installation! Normally not beyond repair, but still&#8230;<\/p>\n<p>So, you start by opening the file wp-config.php in your favorite text-editor (which is Vi, I know \ud83d\ude09 )<br \/>\nNext, you look for this line of code:<\/p>\n<blockquote><p>\/** Sets up WordPress vars and included files. *\/^M<br \/>\nrequire_once(ABSPATH . &#8216;wp-settings.php&#8217;);<\/p><\/blockquote>\n<p>And above this you add the line of code that tells WordPress where to save the media uploads:<\/p>\n<blockquote><p>define( &#8216;UPLOADS&#8217;, &#8216;wp-content\/media&#8217; );<\/p><\/blockquote>\n<p>Or, when you want to place the upload directory outside of the wp-content folder:<\/p>\n<blockquote><p>define( &#8216;UPLOADS&#8217;, &#8216;media&#8217; );<\/p><\/blockquote>\n<p>Since the path is always relative to your WordPress installation, it doesn&#8217;t need a leading slash.<\/p>\n<p>As you can see, it was not that hard to change WordPress&#8217; media upload folder, and who knows, maybe one day, you might just find you need to urgently change it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re an avid user of your WordPress blog, you will no doubt have worked with the WordPress Media Uploader before. This is the interface that let&#8217;s you upload media such as movies and images, and it saves them all happily in the &#8216;wp-content\/uploads&#8217; folder If you use it alot, or if you are doing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6393,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[928],"tags":[1147,899],"class_list":["post-6392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-upload-folder","tag-wordpress"],"jetpack_featured_media_url":"https:\/\/beheydt.be\/wp-content\/uploads\/2017\/07\/Foto-3-08-16-16-25-10.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pbkKxJ-1F6","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/posts\/6392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/comments?post=6392"}],"version-history":[{"count":0,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/posts\/6392\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/media\/6393"}],"wp:attachment":[{"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/media?parent=6392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/categories?post=6392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beheydt.be\/en\/wp-json\/wp\/v2\/tags?post=6392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}