wordpress disable theme editor

  1. Log in to your WordPress admin dashboard.
  2. Navigate to "Appearance" in the left sidebar.
  3. Click on "Theme Editor" from the sub-menu under "Appearance."
  4. Locate the "Theme Editor" link at the top right corner of the Theme Editor page.
  5. Add the following code to the theme's functions.php file or a custom functionality plugin:
define('DISALLOW_FILE_EDIT', true);
  1. Save the changes.

This code snippet disables the theme editor in WordPress by defining the constant DISALLOW_FILE_EDIT and setting it to true. This prevents users from accessing the theme editor through the WordPress admin interface.