• Resolved igwt

    (@igwt)


    wordfence standard scan results include core file no longer needed. Delete file fails with error permission denied.

    Old WordPress core file not removed during update: wp-includes/blocks/post-content/editor.min.css
    File Type: Core
    Details: This file is in a WordPress core location but is from an older version of WordPress and not used with your current version. Hosting or permissions issues can cause these files to get left behind when WordPress is updated and they should be removed if possible.

    Delete file results in error:

    Could not delete file wp-includes/blocks/post-content/editor.min.css. The error was: unlink({WordPress Root}/wp-includes/blocks/post-content/editor.min.css): Permission denied

    How do I fix that ? why do I get this error ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @igwt,

    This error usually occurs when the www-data user doesn’t have the necessary permissions, so Wordfence gets blocked when it tries to perform create/update/delete type operations.

    Ensure permissions on your WordPress site’s directories are 755 and that the owner on your WordPress root directory (and all contained directories) is www-data and try the removal operation again.

    Let me know what you find out!

    Thanks,

    Peter.

    Thread Starter igwt

    (@igwt)

    Hi @wfpeter

    Here is what ls -la command reveals, see code block below:
    Parent folder site has owner root with 755 permissions.
    wp-content has owner www-data with 755 permissions.
    wordpress-core has owner root with 755 permissions.

    Do I need to change chown -R www-data wordpress-core ?
    Do I need to change chown -R www-data site ?

    root@vps:/opt/containers/vwxyz/data/site# ls -la
    total 16
    drwxr-xr-x  4 root     root     4096 Dec 16  2020 .
    drwxr-xr-x  4 root     root     4096 Dec 16  2020 ..
    drwxr-xr-x  7 root     root     4096 Jan  3 18:07 wordpress-core
    drwxr-xr-x 11 www-data www-data 4096 Mar 30 13:50 wp-content
    root@vps:/opt/containers/vwxyz/data/site#
    

    Regards
    -igwt

    Plugin Support wfpeter

    (@wfpeter)

    Hi @igwt, thanks for providing that information!

    Root owning the wordpress-core folder is likely related. If you look at permissions of the file itself that Wordfence was unable to delete, it is also probably owned by root as a result.

    If your WordPress core files are owned by root, the plugin won’t be able to change them but you can opt to remove the old file manually as the root user rather than change the permissions if you prefer.

    Thanks,

    Peter.

    Thread Starter igwt

    (@igwt)

    Hi @wfpeter,

    Ok removed files manually for now, but what is best practice :

    change chown -R www-data wordpress-core ?
    or
    remove manually /opt/containers/vwxyz/data/site/wordpress-core/wp-includes/blocks/post-content/editor.min.css

    Regards
    -igwt

    Plugin Support wfpeter

    (@wfpeter)

    Hi @igwt,

    I have tended to see the recommendation that www-data as owner and 755 permissions on WordPress’ folders and files contained within them, so I wouldn’t see a problem with running the chown command as it’d stop this reoccuring in future if files need to be removed.

    Thanks,

    Peter.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘delete file wp-includes/ fail error Permission denied’ is closed to new replies.