HomeTips & Tricks How to Disable Theme Editor in WordPress Admin Without Plugins

How to Disable Theme Editor in WordPress Admin Without Plugins

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.

Figure of Theme Editor Options in WordPress Dashboard

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.

Your cPanel URL will be like this yourdomain.com/cpanel or something else depending on your Hosting Provider

Step 3: After successfully login to cPanel then click on “File Manager” from FILES section.

cPanel File Manager

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.

wp-config file edit in cPanel

Step 5: Finally copy and paste the following code into wp-config.php file

/**File Edit Disable */
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.

You May Also Like

About the Author: Kedar Adhikari

I am WordPress Themes developer and designer and also any type of website design with minimum cost. for more information you can contact me on email [email protected]

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2024 My WP Helper. All rights reserved.