I have uploaded a new docx and pdf through the media library and the procedure is completed successfully. I can confirm that the direct link actually works.

The problem is being identified when I try to DELETE PERMANENTLY the files.

By clicking on "Delete Permanently", the file record is deleted from the media library, nevertheless the actual file (and its direct link) still resides on disk. On the other hand, Wordpress returns a message that the deletion was completed successfully.

Can you suggest me possible steps to debug the above-mentioned prcedure?

Wordpress 4.7.3 currently resides on IIS 8, with PHP 7.0.x. I have checked some possible user permissions for IUSR, and currently on files is being given full control.

Thank you, Chris

  • I have seen this type of issue when the server "owner" of the file does not match WordPress's user. Even if permissions are set properly the ownership can make the difference.
    – WebElaine
    Apr 3, 2017 at 15:15
  • Or it could be a caching issue. Do you have a caching plugin installed?
    – TomC
    Apr 3, 2017 at 15:33
  • @WebElaine Hello! When Wordpress actually uploads the file, it doesn't automatically becomes the owner of the file?
    – mmystery
    Apr 3, 2017 at 15:43
  • @TomC nope, no caching plugins... But (theoretically), could be unrelated? As the file remains on the actual folder on disk...
    – mmystery
    Apr 3, 2017 at 15:44
  • mmystery, follow-up on @webelaine comment. Do the files uploaded have a different owner and permission than say your wp-config file?
    – rudtek
    Apr 3, 2017 at 15:50

1 Answer 1


So, after several attempts... it is a problem (or a feature) of the WPML multilanguage plugin.

  1. To start with, I have set up correctly the user permissions, as @WebElaine mentioned. Just in case something was not configures properly. More information on the following articles:
    Permissions to wp-content folder in Windows Server 2012
  2. In my case, I had installed the WPML Media plugin. With the default behaviour, on each media file that is being uploaded, the plugin creates as many database records as the installed languages.

    When someone navigates in the media library, and "deletes permanently" a file, it just deletes the database record and not the physical file on disk. The user should browse each language (on back-end, the flag on the upper bar), and "delete permanently" the specific file for each language. More info here:

When the last record is being deleted, then the physical file will be deleted also.

Hope it helps! :)


  • 2
    Thanks! This is the trick :) We need to remove the file for all languages and in my case I dont have the wpml media plugin eather. Jan 19, 2019 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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