• Cheryl

    (@tricheryltops)


    Hello,
    I applied hardening to php files in directories such as wp-content. However, now the “revert hardening” is greyed out for these areas and I cannot revert. I believe it is making me unable to edit certain files myself. I tried whitelisting the files but that did not work. How can I revert hardening for wp-content?
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • I believe this hardening feature actually writes a line to your wp-config.php, thus:

    define('DISALLOW_FILE_EDIT', true);

    …and creates a (or adds the following to an existing) .htaccess file in your ./wp-content directory, thus:

    <FilesMatch "\.(?i:php)$">
      <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
      </IfModule>
      <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
    </FilesMatch>

    By removing these entries, you will in effect be reverting the hardening.

    HTH.

    Thread Starter Cheryl

    (@tricheryltops)

    OK, thanks.

    Just a quick note, I’m not from Sucuri, just a random guy on the Internet trying to help. I don’t know whether undo’ing the hardening should be an option.

    Actually just checked my plugin and there to you don’t seem to be able to revert the hardening, greyed out. See screenshot: https://i.imgur.com/JviZV2m.png. So maybe you can’t (using the plugin itself).

    Thread Starter Cheryl

    (@tricheryltops)

    OK, thanks. I’ll give it a try a bit later. Actually don’t think I need to right now, but I was having trouble deleting one file I should have been able to delete, tried resettling the permissions and everything so I thought the Sucuri plugin was the problem.

    Thread Starter Cheryl

    (@tricheryltops)

    Hi,
    Yes, you were right. It was the rules in the .htaccess for wp-content. I had checked the wrong .htaccess file ??

    And, yes, there are times when you do want to be able to revert hardening. For instance, I was getting 500 errors suddenly on fonts on my site because of the hardening. Removing this rule fixed the problem.

    I know that there’s a way to exclude files from the plugin, but it seems that when I enter them, the / gets stripped and it doesn’t work.

    Thanks for your help!
    Cheryl

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Cannot revert hardening’ is closed to new replies.