Choosing the right content management system (CMS) for your website design can significantly impact your…
When it comes to site content, especially when it comes to content like images , the way they are managed can have a big impact on SEO and overall site performance in general. The answer to the question of how to change the Media library upload folder can certainly be of great help.
By default, WordPress stores all media files like images, videos, and PDFs in a folder called ” Upload “. You can view the image loaded from your site using the following path: https://www.nazivsajta.com/wp-content/uploads/naziv-fajla-slike.jpg
If for any reason you want to change the default folder (in this case the Upload s folder) to any other folder that suits you better, here is a step-by-step guide on how to change the Media library upload folder.
How to change Media library upload folder?
There are two ways to change the Media library upload folder for uploading images and other media:
- Creating a new folder in your WordPress installation on cPanel
- Creating a new folder on a subdomain outside of your WordPress installation
In our text, we will stick to the first method.
Creating a separate folder within your WordPress installation
This will also help you with additional security by moving all your media files outside of the /wp-content folder. These are the steps involved in this process:
- Creating a new upload folder
- Modifying the wp-config.php file
- Moving existing media files to a new folder
- Checking and fixing broken links
- Uploading a new media file and checking its permission
Only the first two steps are required for a new WordPress site , and all other steps are required for an existing site that has media files.
Creating a new folder
Assuming you want to place all your media files in a new directory called for example “Pictures”, you first need to create a folder with that name in the root of your WordPress installation. You can create the folder either using FTP or using the ” File Manager ” option available within the cPanel of your hosting account.
Log in to your hosting account and open the ” File Manager” option available under the Hosting path> cPanel> File Management> File Manager.
Select the root directory where your WordPress is installed.
Select ” Web Root (public_html / www) ” if you installed WordPress in the root directory, or select a subdirectory from the ” Document Root for ” drop-down menu if you installed WordPress on a subdomain or a subdirectory of the main domain.
Selecting the New folder option opens a window in which we create and name a new folder in which we want to store media content, in our case images. After determining the name of the new folder and checking whether the path where it will be saved is correct, click on Create New Folder .
Now within the WP installation we can see the newly created folder, in our case called Pictures.
Modification of the “wp-config.php” file
The next step is to edit the wp-config.php file located in your root directory (usually /public_html) . Click the Edit icon in the File Manager .
Add the following lines of code to the wp-config.php file and save the changes.
define( ‘UPLOADS’, ”.’Pictures’ );
Be sure to pay attention to whether the quotes are correctly written (as in the example above), otherwise the changes will not be applied correctly.
Moving existing files to a new folder
When you change the upload folder in wp-config.php, all existing media (images) from the site will automatically change the URL to https://www.nazivsajta.com/Pictures/naziv-fajla-slike.jpg. This will result in broken links on posts and site pages. You need to move all existing files to the new “Pictures” folder to adjust the broken links. You can do this through the File Manager by dragging and dropping all the image files from the old folder to the new one.
Final checks
The final step is to check if there are still broken links on the site. One way is to use one of the many tools that are available on the Internet.
From now on, every new file uploaded to the site will be saved in the new “Pictures” folder.
Finally, upload a new picture and check if the file path is saved in the newly created “Pictures” folder. If you see an image not found or a 403 error is reported, the most likely reason may be the file permission settings of the newly created folder. To check permissions, connect your FTP software to the server and navigate to the new Pictures folder. Right-click and select File Permissions. Choose the appropriate permission settings and the numeric value should be 755.
We hope that our text explained to you how to change the Media library upload folder. Don’t worry, after years of experience all this will be a cat’s cough. Until then, read more educational articles on our blog.

Made by Nebojša Radovanović – SEO Expert @Digitizer