{user_name}
Removing date folders from subfolder Year and Month in WordPress Media Library for images

Move WordPress uploads out of date folders retroactively

In this guide we show how you can remove the subfolders from media URLs in WordPress retroactively. We present a one-click solution with the neo Rename plugin and compare alternative manual methods such as using WP-CLI or .htaccess redirects. You also get tips on how to maintain your SEO ranking when moving files.

Move WordPress media from year/month folders into the main uploads folder retroactively. Visualization of the folders.

Short & sweet quick solution

  1. Install the neo Rename plugin
  2. In the backend under Settings > neo WP > neo Rename click the "Move media from date folders to main uploads folder" button
  3. Optionally the 301 redirects for SEO are created automatically
  4. Done! 🎉️

By default WordPress organizes uploaded files into year- and month-based folders (e.g. "wp-content/uploads/2026/05"). This option "Organize my uploads into month- and year-based folders" is enabled by default. Many site administrators prefer shorter, cleaner URLs and want to remove the date path components from media URLs. Simply disabling this option later is not enough: files already uploaded remain in their year/month subfolders and keep the old URL structure. This issue has already been discussed in the WordPress forum, on Reddit as well as Stack Overflow and Stack Exchange.

One-click solution - dissolve upload folder structure in WordPress retroactively

Remove year/month subfolders from image URL and file path by moving media into the main upload directory

Move images with neo Rename

The fastest and easiest solution is the neo Rename plugin. With it you can, in one click, move all existing uploads from the year/month subfolders into the main uploads folder. On neo Rename's settings page you’ll find a special button that dissolves the entire upload folder structure.

One click is enough, and the plugin performs all necessary steps automatically:

  • Move media files: All images, videos, PDFs etc. are moved from the subfolders (e.g. wp-content/2026/05/) into the main folder wp-content/uploads/. You don't have to work through FTP folders manually.
  • Update database URLs: neo Rename finds all references to these files in the database (posts, pages, media metadata, etc.) and replaces the old paths with the new path without dates. This keeps all images correctly embedded in posts and avoids broken links. The plugin handles all occurrences in the database including serialized data such as PHP arrays when replacing.
  • Redirects for old URLs: If external sites or Google have already indexed the old media URLs, neo Rename can set up SEO-friendly 301 redirects. A request to the old URL (with year/month folder) will then automatically redirect to the new URL without the date path. Search engines and visitors will land on the correct image despite the restructuring - valuable for SEO and preserving existing backlinks. This does not need to be done manually.
  • Disable WordPress setting: The plugin also turns off the WordPress option "Organize my uploads into month- and year-based folders" so that future uploads go directly into the main uploads folder and are no longer created in date folders.

All steps are performed safely and reliably in one go. It is still recommended to make a backup beforehand.

What else can neo Rename do?

Rename your images and videos in no time and improve your website's SEO performance. All references are automatically updated throughout the entire database.
Thanks to live preview, search-and-replace, batch processing and intelligent renaming rules you optimize your media library in no time and increase your site's visibility.

👑 Pro: SEO-friendly 301 redirects to the new image URL

All features of neoRename:

Why you won't need subfolders anymore?

With the combination of neo Rename and neo Library, manual folder sorting is a thing of the past. You can leave all uploads in the main directory and still find any image in seconds. The neo Library plugin automatically assigns your media intelligent tags without having to sort them manually. Since tags are not exclusive, an image can appear in multiple virtual collections at the same time. This is more flexible than any rigid folder structure.

It's especially useful that neo Library shows an intelligent tag for each of your posts. That way you can directly see which posts reference your image or which images are used in a post. For this, image references are detected not only in post content but also in ACF fields.

Try and download neo Rename directly

The neo Rename plugin includes all the features you need for a thorough cleanup of your media library - from safely moving all files to the main upload folder to automatically updating all database references to SEO-friendly 301 redirects. Test the plugin with the sandbox in the browser or download it directly.

Screenshot neo Rename - Media Renamer for WordPress images to rename filenames, title and slug for SEO optimization
WordPress Media Plugin Rename - Logo animated - title, URL, path, slug and filename of an image are renamedOverlay - This plugin icon was drawn with neo Draw and animated with neo Draw and neo Motion.

neo Rename

Rename images efficiently and maximize SEO ranking!

SandboxTo the plugin

Disable WordPress upload subfolders manually in the settings

If you think about it before installing your WordPress instance, abolishing the date folders by turning off the corresponding option in WordPress is very simple. Go in the dashboard to Settings > Media > Uploads. There you find the checkbox "Organize my uploads into month- and year-based folders." Uncheck it and save the settings. From now on WordPress will no longer place new uploads in subfolders, but directly in "wp-content/uploads".

Settings page in WordPress under Media with checkbox ”Organize my uploads into month- and year-based folders”

Important: This change does not work retroactively. WordPress does not move existing files automatically. All previously uploaded media keep their existing path (e.g. /uploads/2026/05/image.jpg). In the media library or in posts nothing changes initially. That means old images will still have "/year/month/" in the URL, while new uploads will be uploaded without that path. This creates an inconsistent structure unless further actions follow. So if you want a consistent result, you must move existing files manually or use neo Rename, for example.

Why WordPress creates subfolders

WordPress has applied the year/month folders by default since version 2.7 because classic web servers used to have real problems with very large directories. On older disks and file systems (ext3, FAT, NTFS without journaling) listing a folder with tens of thousands of files took much longer, and some backup tools or FTP clients had hard limits for entries per folder. The chronological split ensured that each directory contained a manageable quota of uploads and access times remained stable.

There was also an organizational benefit: someone who blogged daily could quickly go to “/1990/12/” in the FTP directory tree and back up all December images at once. Especially in newsrooms without sophisticated media management, that was a simple, understandable order.

The date-path structure brings some downsides: each image URL is unnecessarily lengthened by two segments, making it harder to read and more prone to typos. The folders implicitly reveal that your site runs on WordPress and mix technical information (year, month) with semantically irrelevant file paths.

Today the technical reasons are largely obsolete. Modern file systems (ext4, APFS, XFS) and SSD storage can manage hundreds of thousands of entries in one folder without noticeable slowdown. Sites are also usually delivered via caching layers, CDN, or object storage (S3, Wasabi & Co.), so the physical directory locally hardly matters anymore.

Ways to remove year/month folders from file path & URL

In addition to the convenient neo Rename method, there are several alternative approaches to tidy up file paths. Below we present different solutions – from plugin options to the developer method with WP-CLI. Important: Many of these approaches require physically moving files and adjusting the database. Theoretically you can also "remove" the date path without reshuffling files (for example via a rewrite rule), but that only masks the problem and is recommended only in special cases. Nevertheless, we also address this solution.

1) neo Rename - the one-click solution

We already described it in detail above: neo Rename provides the one-click solution specifically for this problem. Compared to the following methods, which sometimes require multiple steps, neo Rename is the most convenient and ideal if you want to reach the goal without technical effort. Advantages of neo Rename at a glance:

  • One click, everything done: No switching between tools, no SQL, no manual work. The plugin button handles moving, search & replace in one go.
  • No broken links: All internal links in WordPress are updated so the new paths appear directly in posts & pages. Optional 301 redirects also ensure external links do not lead to dead ends.
  • Additional features: neo Rename can do more (optimize filenames for SEO, bulk renames, restore original names, etc.), helping you keep a tidy media library long-term.
  • neo Library compatibility: Thanks to neoLibrary’s filter and tag system, folder structures are often unnecessary - you can still find your media quickly. neo Rename and neo Library complement each other perfectly to bring order to large media libraries.

Conclusion: The plugin neo Rename is specifically designed to clean up WordPress media paths and makes the entire process beginner-friendly. So if your focus is on speed and safety, this solution is preferable.

To the neo Rename plugin

2) Media File Renamer Pro - the manual route

An alternative plugin solution is offered by Media File Renamer (by developer Jordy Meow). Its Pro version also allows you to rename media files and move them to other folders. You can proceed as follows:

  • Preparation: First disable date-based uploads in WordPress as described above so new files do not end up in subfolders again.
  • Using the plugin: With Media File Renamer Pro you can now reorganize your existing media. The plugin offers, for example, a bulk function to rename and move multiple files at once. You could move all files from a monthly folder into the main uploads folder. In the plugin interface select the media in question and either assign new filenames or keep them and use the option to move them to the main directory.
  • Update references: Media File Renamer updates references in posts automatically when renaming. So if you move files to another path, the plugin should adjust all occurrences of the URL in posts accordingly. Spot-check the result: Is the image still displayed in the post? Is the URL correct?
  • Redirects: As far as we know, Media File Renamer does not create automatic redirects from old to new URLs. That means external links or direct requests to the old paths would return a 404 error. You would need to handle redirects separately (for example with a redirect plugin or via .htaccess).

Assessment: Media File Renamer Pro is powerful and can also perform renaming/moving. However it requires more manual steps and supervision. You may need to proceed folder by folder and monitor the result. With many media files this can be time-consuming. Also be careful: if two files from different monthly folders have the same name, moving them into a common folder will cause a conflict. In such cases you would first need to rename one file to ensure unique names. Make sure no duplicate filenames exist before merging everything into one folder.

Conclusion: For advanced users Media File Renamer Pro is an option to remove the monthly folder. If you already use the plugin, you can try the manual route. Otherwise neo Rename offers a simpler solution tailored to this task.

3) Media Library Folders – drag-and-drop folder management as a middle ground

If you want to get rid of date folders but still keep a real directory structure, Media Library Folders (MLF) offers a pragmatic compromise. The plugin adds a left folder sidebar to the WordPress media library and moves files physically on the server instead of just creating virtual categories. This keeps URLs clean while still organizing files logically by topic.

Features at a glance:

  • Create folders via drag & drop: Folder management similar to Windows Explorer.
  • Physical moving: When moving, MLF automatically corrects all references in posts & pages.
  • Undo & bulk actions (Pro): Undo the last action; move multiple files/folders at once.
  • Multiple assignments (Pro): An image can appear in multiple folders.
  • Server sync (Pro): FTP-created folders appear in the backend – useful for very large libraries.

The biggest advantage compared to purely “virtual” folder plugins: The folders really exist on the filesystem. That lets you back up images via FTP or copy them to CDN storage without losing the folder structure. For editorial teams that like to use themed folders (“/products/”, “/team-photos/”, etc.) this is a familiar workflow and prevents filename collisions.

However, MLF does not create 301 redirects for old paths. If you come from the year/month structure, you must add redirects yourself with a redirect plugin or .htaccess – or use the one-click solution neo Rename, which includes redirects. Also, drag-and-drop sorting takes some time with thousands of images; there is no automatic tagging like in neo Library.

4) WP Original Media Path - adjust upload path

The plugin WP Original Media Path follows a slightly different approach. It allows you to change the WordPress uploads folder - something that was possible in core until WordPress 3.5. With this plugin you can, for example, set your media to live under “wp-content/media/” instead of “wp-content/uploads/”, or even use a subdomain for media. This affects the base path of uploads. Important to know: WP Original Media Path is not retroactive - it does not automatically update existing entries. But you can use it to establish a new unified structure and then switch manually. A possible procedure:

  • Install the plugin and set the new path/URL. You could keep wp-content/uploads (if you only want to get rid of the subfolders) or specify a completely new path (e.g. wp-content/uploads_all or wp-content/media). Save the setting. WordPress writes the new path to the options (database) – all future uploads will go there.
  • Move files: Now move the contents of the old uploads folder to the new location via FTP or shell. If you only want to remove the year folders and stay in the same main path, that means: move all files from uploads/YYYY/MM/ subfolders directly into uploads/. (You can delete the empty year folders afterwards.) If you chose a completely new path, move the entire directory accordingly.
  • Replace database entries: Now you must update all references in the DB so WordPress finds the media under the new path. As described in the plugin docs, a search-and-replace operation is unavoidable. Search for the old base path (e.g. wp-content/uploads/2025/08/) and replace it with the new path (e.g. wp-content/uploads/). Practically you can do this with a plugin like Better Search Replace or WP-CLI. Remember to account for serialized data.

After these steps all media are available at the new path. Existing content points to the new URL. WP Original Media Path has informed WordPress about the changed path; the rest you must handle yourself as with manual methods.

Use case: This plugin makes sense if you want, for example, a completely different storage location for uploads, such as a different directory or a separate domain/CDN. For simply removing the date folders within the same main folder it may be overkill, since the standard path (uploads) would be retained. You could use WP Original Media Path to move all uploads to a subfolder “media” instead of “uploads”. Important: The plugin does not work with Multisite.

5) WP-CLI & Better Search Replace - developer option

For technically proficient users there is the option to remove the date folders without special plugins. For this you must move files manually and update all database entries:

  • Database backup: Always create a DB backup first! A wrong search & replace can render the database unusable. Safety first.
  • Move files manually: Using FTP with FileZilla or SSH with Termius or a script, move the files from the year/month folders into the main uploads/ folder. Be very careful about filename conflicts. If two files share the same name (e.g. image.jpg in "2023/03/" and again in "2026/05/"), they cannot both coexist in "uploads/".
  • Database search & replace: Now all places in the DB that reference the old paths must be rewritten. This mainly affects the post_content column of posts and pages where images are embedded via tags. Additionally, attachment metadata in wp_postmeta or _wp_attached_file entries must be updated; these store the path relative to the uploads folder, e.g. "2026/05/image.jpg". In rare cases widgets, menus, or theme options may also reference images whose paths need updating.
    Most conveniently this is done with the Better Search Replace plugin or via a WP-CLI command. Example WP-CLI command:
    wp search-replace '/wp-content/uploads/2025/08/' '/wp-content/uploads/' --skip-columns=guid

    This would replace occurrences of the path string across all tables and skip GUIDs. You would need to run this per year/month combination or use regex (WP-CLI supports --regex). Alternatively use Better Search Replace in the WP backend, select all relevant tables and search for e.g. /wp-content/uploads/2026/05/ and replace with /wp-content/uploads/. Repeat for all existing year/month combinations. Serialized data: Better Search Replace handles serialized PHP data, which is important so widget configurations or _wp_attachment_metadata are not broken. WP-CLI's search-replace also respects serializations (as long as you don't use regex mode).
    In the wp_posts table each attachment post has a GUID entry with the original URL. It is advisable not to change these GUIDs, as they serve merely as an internal unique identifier (and are relevant for RSS feeds, for example). If you run a general search & replace operation, you might also catch the GUIDs. If possible, exclude the guid column (Better Search Replace does this automatically on a standard run). WP-CLI offers --skip-columns=guid for that. If in doubt it is not catastrophic if the GUID is changed, it just needs to remain consistent and unique.

  • Clear cache: If you use a caching plugin like WP Fastest Cache or a CDN, clear the cache so the newly linked images are delivered immediately.
  • Check: After the run, verify that the media now load correctly without date folders. Especially in posts: do all images work? A quick way is to open the page and check the browser console for 404 errors. Thumbnails should still be visible in the media library. Also disable the browser cache in the developer console.

This manual method ultimately achieves the same result as the plugin solutions, but requires great care and experience. Advantage: You need no extra plugins (except possibly Better Search Replace, which you can remove afterwards) and you have full control. Disadvantage: It is error-prone - a wrong search term or missed step can lead to broken images. And it is time-consuming, especially with many folders and files.

6) .htaccess rewrite rule (redirect without moving)

If you do not want to move files but still want to change the external URL structure, you can use rewrite rules. One solution is to redirect visitors from a requested date-path URL to the corresponding URL without the date path or vice versa. Two approaches:

  • Variant A: files were moved, redirect old URLs: This corresponds to the manual method supplemented with a .htaccess redirect rule. Suppose you moved all files into the main directory. Now create an .htaccess in wp-content/uploads/ with the following content:
    RewriteEngine On
    RewriteBase /wp-content/uploads/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([0-9]{4})/([0-9]{2})/(.*) /wp-content/uploads/$3 [L,R=301]

    This rule does the following: If no real file is found under uploads/YYYY/MM/Filename, send a 301 redirect to /uploads/Filename. The placeholders ([0-9]{4}) and ([0-9]{2}) capture year and month numbers, $3 represents the filename possibly followed by a path (in case subdirectories were ever included in the filename). For example, requests to /uploads/2026/05/menue.pdf are redirected to /uploads/menue.pdf. The [R=301] status ensures it is a permanent redirect (useful for SEO). This solution is very elegant for catching existing external links or search engine index entries of the old URLs and routing them to the new paths. It should be placed in the uploads directory (not the main .htaccess) so it takes effect before WordPress.

  • Variant B: Keep files in subfolders and internally rewrite new short URLs: This is the reverse case: you leave the files physically where they are (in 2026/05 etc.) but want to show “short” URLs on the site and to visitors. That means you would need to change post content so it references images without the date path. To make those links work without moving the files, you need an internal rewrite rule that resolves a request for /uploads/image.jpg to the actual file location /uploads/2026/05/image.jpg. This is more complex because the server somehow needs to determine which year folder the file is in. Writing a global rule for that is not trivial - you would have to try every year/month combination or have a fixed logic. If filenames are unique, you could try to find the correct path via RewriteMap or a script, but that goes beyond standard .htaccess rules. In short: this variant is doable but time-consuming and error-prone. In practice it’s rarely used. It would be easier to move the files or choose one of the other approaches above.

Use .htaccess redirects mainly as a supplement to catch old URLs after restructuring (Variant A). That preserves the SEO value of your images and prevents 404 errors. If you use neo Rename, you don’t have to worry about this. The plugin can add the redirects automatically.

FAQ & Troubleshooting

Backup & Safety - Do I have to make a backup before changing the folder structure?

Yes, absolutely! Changes to file paths and the database are potentially risky. Create a full backup beforehand (database and wp-content). That way you can restore the state if needed. Plugins like Better Search Replace explicitly warn against working without a backup.

Filename conflicts - What if files with the same name exist in different month folders?

If you consolidate all files into one folder, filenames must be unique. Check whether image.jpg exists in 2023/03 and in 2026/05, for example. If so, you should rename one of them (e.g. image-2.jpg) before merging. Tools like neo Rename or Media File Renamer can help because they allow bulk renaming. Without that preparation, moving files may overwrite one with another, causing data loss!

Multisite specifics: Does this also work on WordPress Multisite?

In Multisite setups each subsite has its own upload path (uploads/sites/...). The “Organize into month/year folders” option exists per site. You must proceed separately for each site. Also, on Multisite you should never put different sites into a shared folder. Keep the per-site separation to avoid collisions.

SEO impact: Do year numbers in the image path affect my SEO ranking?

No. Folder names do not affect SEO. More important are the filename itself (keywords), alt texts, page speed, etc. Removing the year folders therefore neither gives a direct SEO boost nor harms it. It is primarily a matter of aesthetics and organization. Just make sure to set redirects so existing index entries do not lead to dead links - that could otherwise hurt SEO.

External links & redirects: What happens to old image URLs that are already embedded somewhere?

Without measures these would result in 404s once you move files or change paths. That is why redirects are so important. The neo Rename plugin handles this automatically with 301 redirects. If you work manually, set up a .htaccess redirect rule (see above) or use a redirect plugin to point old URLs to new ones. Make sure the redirects are permanent (301) so Google adopts the change. With correctly configured redirects your images retain their “Google juice” and users following old links are taken seamlessly to the new address.

Rollback: Can I undo the change?

In theory yes, but not with a single button. You would need to move the files back to their original folders and adjust the DB entries again (or restore from backup). The Pro version of neo Rename offers an undo function for individual renames, but fully rolling back the folder structure also requires a backup. So think carefully before you proceed and ideally test first in a staging environment or test site.

Troubleshooting: What if individual images are missing or loading incorrectly after the change?

Proceed systematically. Check the image path in the page HTML (is it correct or still pointing to an old folder?). Check the database entries for an affected image (wp_posts and wp_postmeta for the attachment ID). If they still contain year folders, you may have missed a search-and-replace. Also check write permissions on the uploads folder (the uploads/ folder should remain writable by WordPress, typically 755). If unsure, you can run a plugin like Regenerate Thumbnails. This plugin generates new thumbnails based on the paths stored in the DB. If that fails, something is still wrong with the path entries.

Conclusion

Removing year and month subfolders from media URLs can be achieved in different ways. For anyone who wants to be safe, the one-click solution with neoRename is recommended. It saves you time and minimizes sources of error. But regardless of the chosen path: plan carefully, make backups and remember redirects to avoid SEO losses.

At the end of the day it is mainly an aesthetic/organizational decision whether you want to keep the date structure. WordPress gives you the choice. If you opt for cleaner upload URLs, you now have the appropriate solutions at hand.

The neo Rename plugin (part of the neo WP plugin suite) takes the work off your hands and additionally offers many features to optimize your media library - from bulk renames to SEO redirects. Together with the other tools in the neoUniverse (neo Library, neo Replace, neo Optimize etc.) you have everything to take your WordPress media management to a new level.

★★★★★

Rate now!

[{user_coupon}]

{user_discount} Discount

Redeem now!