wordpress disable edit files

  1. Go to your WordPress dashboard.
  2. Click on "Appearance" in the left-hand menu.
  3. Select "Theme Editor" from the submenu.
  4. In the Theme Editor, locate the file you want to disable editing for.
  5. Click on the file to open it.
  6. Add the following code at the beginning of the file:
defined( 'DISALLOW_FILE_EDIT' ) or define( 'DISALLOW_FILE_EDIT', true );
  1. Click the "Update File" button to save your changes.