WordPress Disable Theme Editor and Plugin Editor

WordPress Disable Theme Editor

You may have a question in your mind, Can’t WordPress disable theme editor? You can edit theme and plugin whenever you are logged in to the dashboard. By default, it is present in WordPress. It may look good as it makes things easier. However, this may be the root cause to break the sites if misused.

Need to disable WordPress Theme and Plugin editors

If you are using WordPress from some period of time, then you may also already know that you can edit the code written in themes and plugin from the dashboard.

You can go to theme editor from the location Appearance >> Theme Editor

WordPress Theme Editor
WordPress Theme Editor

In this window, you can select the theme that you want to edit from the dropdown arrow button shown above.

In addition, you can also edit the code written in the plugin from the location Plugins >> Plugins Editor

WordPress Plugin Editor
WordPress Plugin Editor

Similar to themes, you can also choose the plugin that you want to edit from the box shown above.

If you are opening the editor the very first time, WordPress gives you a warning that the selected action may break your site.

Before you want to proceed, make sure either you know about coding or at least you should have a certain objective to enter in this editor. While changing the codes via. the editor, you may want to keep the backup of the site in case of any accidental changes.

The editor allows you to change the code completely. If unauthorized users get access to your site, they can steal all your data from the dashboard. So, you must be careful while storing and securing your admin password. Now Let’s find an answer to Will WordPress disable theme editor?

WordPress Disable Theme Editor and Plugin Editor   

To perform this action, when you are logged in to your dashboard edit wp-config.php file. Search the line ‘That’s all, stop editing! Happy publishing’

Paste the below code above this line:

define( ‘DISALLOW_FILE_EDIT’, true );
Disable Theme Editor in WordPress
Disable Theme Editor in WordPress

Save the changes and update the file. After this addition, you will no longer see the theme and plugin editor in the respective menus. This only takes a minute.

Step Ahead in Security

Sometimes you may want to add the security of the site more than that. If you do not want to add a new theme, update the existing theme, add a new plugin, or delete existing plugins, then it will be useful to you. In fact, it prevents you from file modifications.

For these, add the following code:

/** Disable File Modifications */
define('DISALLOW_FILE_MODS',true);

This will block most operations on your site as mentioned above. This will keep your site safe from hackers if in case they get access to your site. If you are working on a client project, you should consult with other developers first before implementing this code, as the other developers will not be able to maintain the site after the addition of this code. If you are a sole developer and have the permission of the client, you may go for it.

Wrapping Up

Hopefully, you learned how to disable the theme editor and plugin editor in WordPress. You can do this either directly from the WordPress dashboard or from the File Manager. The wp-config file is one of the important locations of your site. So, you should be careful while editing.

If you are a beginner or if you are not familiar with coding too much, then you must mess too much with the editor.

Further Reading