WordPress includes dashboard editors that can change plugin and theme code files. This guide explains how to disable those editors to reduce accidental code changes and limit one route for misuse of an administrator account.

Disable the file editors

  1. Back up wp-config.php from the website’s WordPress directory.

  2. Open it in a plain-text editor or your hosting panel’s File Manager.

  3. Check for an existing DISALLOW_FILE_EDIT definition. Update it rather than adding a second definition.

  4. Add or set this line inside the PHP code, before WordPress loads wp-settings.php and normally before the stop-editing comment:

    define('DISALLOW_FILE_EDIT', true);
  5. Save the file and check that the website still loads.

  6. Sign in as an administrator and check that Theme File Editor and Plugin File Editor are unavailable.

Understand what changes

This setting disables the code-file editors. It does not disable the block-based Site Editor or prevent normal theme and plugin updates. It also does not stop someone with filesystem access from editing files through SFTP or the hosting panel.

Use backups and a suitable external editing workflow for code changes. Disabling these editors is one precaution, not a substitute for secure accounts and maintained software.