how do I set WordPress to overwrite files when uploading a file with the same name as a previously uploaded file? By default, WordPress changes the file name. If I have a file uploaded as image1.png and the try to upload a new one with same file name, the second file will be name image11.png. I want WordPress to replace the old file with the new one. Is this possible?
Leave a Reply
You must be logged in to post a comment.
Adding the following to your functions.php file should work:
With the above if you upload a file that is already uploaded, it will overwrite that image. The above was sourced from here, but tested on WordPress 3.9.2