0

When I upload an image (test.jpg) with the Media manager it creates the same image with a digit after its name (test1.jpg).

I disabled image cropping so files like test-[width]x[height].jpg don't appear on upload. But I still have duplicates of the images.

So how could I disable this copying and renaming?

1

The renaming to test1.jpg is not due to any cropping / resizing functions WordPress. This is because you already had a file named test.jpg uploaded, and WordPress does not replace files if one exists in the folder that has the same name. If, for some reason you want it to replace files rather than rename it (not recommended) you can use a plugin like: https://wordpress.org/plugins/overwrite-uploads/ and it will not rename your files, it will replace existing files.

  • Thanks. I found that place in the wp-admin\includes\file.php _wp_handle_upload() function. The wp_unique_filename() part helped me undestand that I should upload images from the outside of the WP uploads folder. – mortalis Mar 23 '15 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.