One of the most amazing features that WordPress offers is the ability to install themes and plugins and create a website in minutes. However, sometimes we may want to make changes to the theme or plugins by modifying the code and for this WordPress allows direct access to the themes and plugins’ files from the WordPress Dashboard to edit it as per needs. This feature is pretty handy but can be dangerous too if you are a beginner and may ruin the entire website if you don’t how to handle the code. So, let’s find out how to disable the theme editor and plugin editor in WordPress Admin Panel.
How to Disable Theme editor and Plugin editor in WordPress
WordPress allow users to edit the theme files and plugin files through the admin panel and this feature is enabled by default in all WordPress installations.
Many times users end up ruining the entire website by trying to edit the WordPress themes code or Plugin codes and for this reason you may want to disable this feature.
It is always a good idea to disable the theme editor and plugin editor in WordPress Admin panel to prevent your website from getting screwed up.
In this article, we will share with you a one line code that will disable theme and plugin editors functionality from WordPress.
So, let’s find out how to disable to the theme editor and plugin editor in WordPress with a single line of code.
- Access your wp-config.php file and open it. Instructions to locate your wp-config.php are in this post – How to Fix error establishing database connection in WordPress
- Open or choose the edit option to edit wp-config.php file and paste the following code anywhere in the file on a new line:
1 | define( ‘DISALLOW_FILE_EDIT’, true ); |
Tip: wp-config.php file is located in the root folder of your WordPress install whether you access the hosting server through FTP or File manager in cPanel.
3. Save the file and upload back to the root folder through the file manager or FTP.
You are done with the changes and once you refresh the WordPress Admin dashboard you would notice that the theme editor and plugin editor functionality is disabled.
How to find WordPress login URL
How to Migrate WordPress from old web host to a new one
How to install WordPress Theme
Elementor Templates for WordPress
21 Best Websites to Download free WordPress Themes
23 Best Web Hosting for WordPress
Note: Build a Strong Online Presence with Business Website Free , Free company Emails and Free Success marketing for your small business like other 10000 small business owners. Get Started Free!
These are really helpful steps to disable Theme editor in WordPress. Thanks so much!
Hello there, I just want to thank you for writing this post and explaining so well on how to disable theme editor in wordpress. Really helpful!
Thanks for sharing!