Stop WordPress sorting uploads into year and month folders, so new files go straight into /wp-content/uploads/.
add_filter( 'pre_option_uploads_use_yearmonth_folders', '__return_zero' );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
By default, uploads go into folders like /uploads/2026/11/. Some people prefer shorter URLs and one folder, for example on small sites with only a few hundred files. This snippet turns the date folders off.
The uploads_use_yearmonth_folders setting controls date folders. The pre_option_ filter returns 0 before WordPress reads the setting, so new uploads go into the main uploads folder.
Upload a file and check its URL. It should be /wp-content/uploads/filename.jpg with no year or month.