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

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