How to change the wp_upload_dir() path in plugin
The upload directory and URL paths are stored in the options database. You can change them using update_option(): update_option( ‘upload_path’, ABSPATH . ‘/path/to/uploads’ ); update_option( ‘upload_path_url’, site_url( ‘/uploads/’ ) ); However, it’s best not to use this in a publiuc plugin, as it will cause numerous issues. We can instead hook into the filters that … Read more