How to Customize Media Upload Folder in WordPress/WordPress

Despite the improvements in the WordPress media manager, one thing remains unchanged: How WordPress stores media (e.g. files, images, video and audio) in the server.

Currently, WordPress sorts files into folders based on date, unless we opt out Settings > Media, in which case all uploaded media files will not be classified into subfolders. So far WordPress doesn’t offer many options to customize this particular area.

If you don’t like this, and want customize the path structure where these files are stored, For example. store it in a folder with a name that matches the post’s permalink, or change the “upload” name to something else, here’s a quicktip to follow.

With the help of a few plugins, we can now make our website more personalized and organized with custom file structures.

Change default “upload” Folder

By default, WordPress will store uploaded files in wp content/upload folder. WordPress allows us to customize the upload directory destination. A good reason to change this default is to make your site look less WordPress-y.

Instead of wp content/uploadupload the files to a folder named files. First we need to create the directory.

Now let’s tell WordPress to upload our files in that directory. Open the WordPress wp-config.php file, then add the following code Yêu cầu_once (ABSPATH.'wp-settings.php '); declaration.

 định nghĩa ('TẢI LÊN', 'tệp'); 

New uploaded files should be stored in “files” folder, as shown below.

This ability is actually available through Settings > Media screen editing back in version 3.0. WordPress has replaced this function with the above function in version 3.5.

Read More:   Understanding WordPress/WordPress custom meta boxes

If you are too afraid that you will ruin everything when editing wp-config.phpyou can install this plugin called Upload URL and Path Generator by Gregory Viguier this will bring the option back in Settings > Media Page. Note that even though this plugin hasn’t been updated for more than 3 years, it still works fine in the latest version of WordPress as not much has changed in this area in WordPress.

Once it is installed, you will find 2 input fields, as shown below:

These two new options will be useful, say, if you want to distribute your files through a subdomain. Assuming you created a subdomain (from your hosting control panel), there should now be a new folder linking to the subdomain. Put the folder name in the “Archive uploads in this folder” field and the subdomain in the “Full URL path to file” field.

Your file will now be sent via the subdomain.

Note that if you chose a subdomain as the example above, you may need to point DNS for the subdomain that matches your website’s IP address

Last, Ched All sent you details about the topic “How to Customize Media Upload Folder in WordPress/WordPress
❤️️”.Hope with useful information that the article “How to Customize Media Upload Folder in WordPress/WordPress
” It will help readers to be more interested in “How to Customize Media Upload Folder in WordPress/WordPress
[ ❤️️❤️️ ]”.

Posts “How to Customize Media Upload Folder in WordPress/WordPress
” posted by on 2023-01-17 22:11:39. Thank you for reading the article at

Read More:   Top 10 Keto Diet Forums, Discussions and Message Boards in 2021
Back to top button