Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#49314 closed defect (bug) (duplicate)

WordPress Adding "-1" to Uploaded Images

Reported by: WebmasterT Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.3.2
Component: Media Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

This problem occurs even when I deactivate all plugins and use the default theme.

It began on December 13, 2019.

When adding an image into the WordPress data that is labeled:


Wordpress has begun adding a -1 after the file name, creating:


This "-1" is typically added only when the exact same file name already exists in in the database.

Now WordPress is adding it to any upload like this:


If I add a picture with a file name like this (I actually added this into the database for you to see):


Wordpress doesn't add "-1"

But when I change that same file to this file name (I actually added this into the database for you to see):


Wordpress does this to the file name:


Again, no other previous upload for "qorianka-kilcher-the-new-world-01-1896x812' exists in our system.


I showed this problem to my website host, and this was their reply:

I have set up a brand new fresh installation of WordPress on my personal account. There are no plugins or themes. The installation was performed specifically to test this on a fresh install.

[0159][root@sip1-228 /home/ehegelne/wp.ehegel.net/html]$ find . |grep -i jelly

[0200][root@sip1-228 /home/ehegelne/wp.ehegel.net/html]$ find . |grep -i koala

As you can see the same behavior occurs. I am not sure why Wordpress does this, but it is default behavior of the application.


Can this error be fixed please so that when a person adds a non-duplicate file like this-picture-upload-01-700x400, a "-1" is not added to it?

Thank you.

Change History (1)

#1 @SergeyBiryukov
2 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac! Thanks for the ticket.

That behavior is indeed new in WP 5.3.1, introduced in [46822] / #42437.

You can read more about the reasons behind the change in tickets #48974 and #42437, specifically these comments:

Hope this helps. Since it's the same issue as reported in #48974, the discussion can continue there if necessary.

Note: See TracTickets for help on using tickets.