Media not actually deleted on disk when click “Permanent Delete”

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

1
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
    https://www.chillies.co.za/news/4421/The-Correct-Permissions-for-WordPress-on-IIS/
    https://www.customfitonline.com/news/2013/6/20/solve-wordpress-on-windows-server-problems/
  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:
    https://wpml.org/forums/topic/deleting-from-media-library-does-not-delete-from-server/
    http://wpml.org/documentation/getting-started-guide/media-translation/

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

Hope it helps! 🙂

Chris

Leave a Comment