In this tutorial, we are showing you about how you can disable file editing (Theme Editor) in WordPress Dashboard for users by adding a small code into your wp-config.php file. So if you are using this method then file editing (Theme Editor) options will be hidden from WP Dashboard and any user can’t be use this options from admin dashboard.
Why necessary to disable file editing (Theme Editor) options from admin? Because when file editing is enabled in dashboard, any admin easily can edit the code of themes directly from the WordPress dashboard but this is not good. Because this is a potential security risk and everyone have no the skills to write code, and in case if a hacker breaks in, they would have access to all your data then your site is will be can breaks. So that’s why we recommend disabling it and for guide follow the below step.
Method for: Disable file editing in WordPress admin Step by Step
Step 1: Login to your Root folder/cPanel with current username and password, if you have not access this so then ask to your Hosting Provider or Web Developer.
Step 3: After successfully login to cPanel then click on “File Manager” from FILES section.
Step 4: Now double click on “www” folder and chooser your domain name, if there has added multiple domain name, Otherwise now find and right click on the “wp-config.php” file name and click on “Edit” options, again click on “Edit” button from opened new dialog box. and go to file editor mode.
Step 5: Finally copy and paste the following code into wp-config.php file
define( ‘DISALLOW_FILE_EDIT’, true );
Now click on “Save Changes” button from top right corner and close the window.
Now you can go to WordPress Dashboard and refresh the page there is will be hidden Theme Editor options.
Suggestions: in some time you wanna to temporarily allow to file editing, so then you can simply replace “true” with “false“. and change it back when you are done editing on WordPress dashboard.
In the end
I hope you have found this article helpful. Let us me your opinion or questions if any through the comment form in below or use this form to ask your question.