wordpress disable theme editor
- Log in to your WordPress admin dashboard.
- Navigate to "Appearance" in the left sidebar.
- Click on "Theme Editor" from the sub-menu under "Appearance."
- Locate the "Theme Editor" link at the top right corner of the Theme Editor page.
- Add the following code to the theme's
functions.php
file or a custom functionality plugin:
define('DISALLOW_FILE_EDIT', true);
- 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.