WordPress comes bundled with a code editor which allows you to edit your theme and plugin files from your Dashboard. To access theme editor you need to navigate to Appearance > Editor and to access plugin editor you need to navigate to Plugins > Editor.
Although this feature comes in handy, it can lead to serious issues like source code modifications by someone with the admin access who is not familiar to programming, leading to the website crash or malware installation by a malicious user who somehow managed to gain admin access.
You can easily avoid these issues by disabling the theme and plugin editor from the dashboard. All you need to do is open your wp-config.php file located inside your root directory. And drop the following code before the line that contains /* That’s all, stop editing! Happy blogging. */ comment.
define( 'DISALLOW_FILE_EDIT', true );
And that’s it! This will remove both theme and plugin editor from your WordPress dashboard.