By default, WordPress organises media files, like images, into folders based on the year and month the file was uploaded. This can cause issues later on if you need to update files, so it’s a good idea to decide on the URL structure for media before you start building your website.

The WordPress dashboard contains the settings that control month- and year-based folders. To remove dates from URLs in your WordPress media file uploads:

  1. Go to the WordPress Dashboard
  2. Choose Settings > Media
  3. Disable the checkbox next to Organise my uploads into month- and year-based folders
  4. Choose Save Changes.

Existing files won’t change retrospectively. Media is only affected when it is uploaded — and they stay that way.

Pros and Cons

Search Engine Optimisation

From an SEO perspective, there’s no real benefit to using dates within your URLs. Excluding dates will make each URL shorter and improve readability. Shorter URLs are considered more favourably for search engine optimisation and websites that adopt a good URL architecture with concise and meaningful URLs perform better.

Using dates in URLs also means larger HTML page sizes and skews the text-to-HTML ratio, both of which are SEO factors. Even though this is a relatively minor issue, you should always keep your code as concise and efficient as possible for performance reasons — the use of dates in media URLs is simply unnecessary.

Website performance

If you have a large WordPress website that uses a lot of files, then saving media into different URLs may have advantages. Every operating system has its limitations and performance degradation based on the number of files that exist in a single directory. Locating the correct file takes more time as the number of files grows. Using multiple folders to store media files can improve website performance in this scenario.

When we talk about performance degradation in WordPress, we generally mean tens of thousands of files per folder. The majority of WordPress sites don’t publish that number of files, so performance won’t be a concern. Even if you have a large number of media files, you should consider serving these through a dedicated storage service and CDN to shift the load away from your web server.

We can help with website performance if you’re experiencing issues with your WordPress website.

Website maintenance

One of the main issues with using dates in URLs is that it can create extra work with updating static content on your WordPress website. These include logos, Open Graph images, images linked in email templates, backlinks to media from other websites and so on. With date URLs active, updating media will also change the media URL, and that means breaking the file path for anything that relies on it. The exception is where the change is made in the same year and month as the original media, the filename is the same and provided the original media is deleted before uploading the replacement. If not, you’ll need to update every system that points to the media to keep things intact, and that can be a nuisance.

Recommendations

Enable Media Replace plugin

The Enable Media Replace plugin by ShortPixel can be a real time saver. It allows you to replace existing media files in WordPress without changing the URL. The plugin integrates directly with the WordPress Media Library and is compatible with major caching plugins like WP Rocket and image optimisation plugins like Short Pixel Image Optimiser.

Mixed settings

A feature of the Organise my uploads into month- and year-based folders option in WordPress is that it only applies as media is uploaded. This provides a level of control that enables you to deal with static media, such as logos, differently from other media content.

When first building your website, upload common static media with the setting disabled so they won’t save to a dated folder. For all other media, you can upload with the setting enabled. If you need to update media that doesn’t have a date URL, disable the setting again before you add the replacement.