• Hey there chaps,

    any idea why file_edit or file_mods to true, somehow WordPress still shows and allows Plugin Editor and Theme Editor to be used directly from the Admin Panel?

    Just to make clear – I would like to disable them completely. I don’t need to edit any file from the website. I’d rather do that manually and completely disable those functions.

    Usually, the code below works… (see screenshot: https://i.ibb.co/5ksfDJ1/Capture.jpg)

    define( 'DISALLOW_FILE_EDIT', true );
    define( 'DISALLOW_FILE_MODS', true );

    Any suggestions how to solve that or what is going on? Why is not working? For now, I’ve just deleted both of the files file-editor.php and theme-editor.php from the wp-admin folder, just to be safe.

    Regards,
    Rasu

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you verified that when you do click Edit for the Theme or a Plugin, that it actually displays the Save button under the file?

    I’ve just deleted both of the files file-editor.php and theme-editor.php from the wp-admin folder, just to be safe.

    No.
    Don’t do this.

    Some things:
    Do you have any other plugins installed? (especially secuirty plugins)
    Did you verify that the constants are not accidentally in your config file twice?
    Can you change the ‘curly quotes’ in your file to single quotes?

    As an aside, be sure to add your salt:
    https://api.www.ads-software.com/secret-key/1.1/salt/

    Thread Starter MFA

    (@mfabowl)

    Yes. The files can be saved. Why not to delete them? Yes, I do have security plugins, but that is not the problem. The constants are not duplicated in the config file – I’ve checked 10 times. Changing quotes doesn’t change anything. The salt keys are fine.

    Any other suggestions?

    Disable the security plugin.
    Check your php error logs.
    Run the site Health Check plugin.

    Thread Starter MFA

    (@mfabowl)

    Erm… Thanks! It was a conflict between the constants in the config file and SiteGround Security plugin. SG has an option “Disable Themes & Plugins Editor” and it was switched on. Turning it off solved the issue. Many thanks for the tips.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘DISALLOW_FILE_EDIT doesn’t work’ is closed to new replies.