Move image upload folder in wordpress to one directory instead of year/month


WordPress images are uploaded to the year month folder.

When you upload an image to WordPress, it goes under the wp-content/uploads folder. At this time, a folder is created for each year and month of the upload time and images are uploaded to that folder.

For example, if you uploaded an image in November 2020, the 11 folder and 2020 folders under it are automatically created, and the image is uploaded to the 11 folder.

wp-content / uploads / 2020 / 11

 

It has now established itself as a WordPress website CMS, but it seems to have started as a blog and divided images into folders by year and month.

In fact, if there are too many files in one folder, it becomes slow when managing files or when the OS gets a list of files.

 

 

There is no time information in the image on the website

There is a point of writing, but I do not like images being divided into year month folders because images are reused and sometimes searched through ftp. The date is as important as the time the photo was taken and the time of writing.  Back up digital photos to a folder with a year/month/day format.But I don't want to manage the images on my blog or website that way.

In the case of the homepage, it is better to view only the images in the /images directory. Occasionally, when you see an image of a WordPress homepage under the year/month folder, you wonder if the image is meaningful at that time. The year/month of the folder is not the date the image has, but the time it was uploaded.

 

However, there is a page that is edited with Elemento on one other site that is operated, but it is uploading images because it does not know how to directly put the image source URL. (If anyone knows how to put the URL directly without selecting from the media of the image when editing with an element, please leave a comment.)

 

 

Set the image to be uploaded to the uploads folder instead of the year/month folder

 

Blogs, websites, and images are uploaded to the wp-content/uploads folder without dividing the folders by year and month.

It is provided as a setting in the WordPress admin.

 

 

Turn off automatic classification on a single site

The method is simple. You can save by turning off the 'Categorize my files by year/month' option in the media settings of the WordPress admin.

It is on by default when installing.

 

 

 

Turn off Auto Classification in Multisite

 

There is a multi-site function that allows you to run multiple sites as subdomains or subdirectories by installing one WordPress.

However, in multi-site, the above option is not visible in the admin settings.

There is a way. In WordPress, the option is hidden in case of multi-site.

 

You can connect by directly entering options.php as follows in your admin access URL.

  1. Connect to wp-admin/options.php.
  2. The input of uploads_use_yearmonth_folders is set to 1, change it to 0
  3. Click the [Save Changes] button to save.

 

Images uploaded from then on are all uploaded under the uploads folder, not the year and month.

 

If year/month is turned off, previously uploaded images in media will not be visible.

there is a problem.

You can see what you upload to the media from now on, but you don't see what you've uploaded before.

I don't remember when the function called media started, but it seems to save the file in the DB when uploading, rather than showing the file in the directory.

So it seems that only those uploaded through the media are visible. As with most programs, you must register through your program. Direct upload via ftp is not allowed.

 

You can register the image with the add from server plugin.

I also found a way to solve this. Again, there are plugins. It is also the power of open source. add from server You can use a plugin called

 

 







Recommendations





0 If you like the article, please click the heart~ It will be a strength to bloggers (SNS/login/advertising is not related)



Articles you might like







Push-Up Star: Push-Up Counter

Automatic push-up measurement and voice count, various types of push-up measurement and push-up speed analysis, police officers, military fitness test, military academy, student health fitness assessment (POPs), etc. automatically calculated












Add a Comment

Email addresses are not disclosed. Required items *is indicated by

























This posting is part of Coupang Partners' activities, and a certain amount of commission is provided accordingly.