Enabling WordPress file editor

Hey!

I have deployed a WordPress site in Digital Ocean using Trellis + Bedrock and I want to enable the WP file editor.

I have changed define('DISALLOW_FILE_EDIT', true); to define('DISALLOW_FILE_EDIT', false); in config/application.php. I also changed the theme files permissions to 777. It isn’t working. The Editor menu inside Appearance doesn’t even appear.

Can anyone help here?

Thanks a lot!

WordPress is for content management, not development; enabling the file editor is asking for trouble. It goes against several best practices (no version control, no testing) and is potentially a security risk (you shouldn’t leave your files at 777 either).

If you really must enable the editor, you need to set define('DISALLOW_FILE_MODS', false); in the config for your staging (hopefully never your production!) environment.

I understand why it goes against several best practices. I find it very useful for testing some CSS changes in staging because it is faster than having to deploy.

I have tried setting define('DISALLOW_FILE_MODS', false); under the line define('DISALLOW_FILE_EDIT', false); in application.php but the menu is still missing.

As I said, you need the definition inside the environment config, which for staging is: config/environments/staging.php, not config/application.php.

The warning was given for the benefit of anyone else reading; they should know that it’s not something we would ever recommend as there is always a better way (which in your case is to test the CSS changes on your development environment).

1 Like

Thank you very much for detailing the solution, Foxaii. I didn’t understood it in your first message. Thanks for your time!

This topic was automatically closed after 8 hours. New replies are no longer allowed.