How To Disable File Editing For WordPress Themes And Plugins
April 29th, 2017 | by Ravi Chahar || Leave a comment |
By default, anyone can edit the theme files from your WordPress admin panel using its editor. Have you ever thought to disable file editing so that no one can see this editor option?
Yes, this can be a better step for your website’s security. Many websites get hacked because of the brute force attack and they mismatch the design by adding extra code in the theme files.
It’s because the editor is accessible to anyone who logs into the WordPress admin panel depending on the role provided.
For better security, you should disable file editing so that in case someone wants to break your website design can’t be succeeded.
Remove The Editor Option From The WordPress Dashboard
You don’t need to use any plugin. Just a simple one line of code and you’re all set.
Most of the web developers access the theme files and change the design. It doesn’t matter whether you’re using a child theme or the parent theme.
The WordPress editor will show the present theme files.
When you go to Appearance>>Editor will be an option at the last. If you open this, you will see the files consisting the codes of the WordPress theme you’re using.
It can be a vulnerability. To secure the design of your website, you can remove this option.
You have to edit the wp-config.php file. Go to the cPanel of your web hosting. I hope you know how to edit the wp-config.php file.
Navigate to file manager>>public_html and you can easily find this file along with all the other WordPress directories.
Add this code at the bottom and save.
// Disallow file edit
define( ‘DISALLOW_FILE_EDIT’, true );
Once you add this code, log in again to your WordPress admin panel and go to Appearance. The editor option would be gone.
You wouldn’t see any such option to see the coding of your WordPress theme.
You have successfully removed the editor option and blocked the file editing feature for your WordPress website.
Disable File Editing In WordPress And Secure Your Website
It’s always recommended to take the necessary steps to secure your website. It’s not a new thing that millions of websites get hacked every year.
You should always consider the WordPress security tips as your main priority. Most of the WordPress users don’t have any idea about such technical things.
It’s recommended to disable file editing for your WordPress themes and plugins. If you have doubt, feel free to ask.