How to remove date from media url?

To remove the date from the WordPress media URLs (e.g., https://yoursite.com/wp-content/uploads/2024/12/your-image.jpg to https://yoursite.com/wp-content/uploads/your-image.jpg), you can change the media upload path.

Goto Settings -> Media.
menu_settings-media
Uncheck "Organize my uploads into month- and year-based folders".
setting-media-uploadingfiles
Step 3
Click "Save Changes" button.