window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/wpbrilliance.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.3"}}; !function(e,a,t){var r,n,o,i,p=a.createElement("canvas"),s=p.getContext&&p.getContext("2d");function c(e,t){var a=String.fromCharCode;s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,e),0,0);var r=p.toDataURL();return s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,t),0,0),r===p.toDataURL()}function l(e){if(!s||!s.fillText)return!1;switch(s.textBaseline="top",s.font="600 32px Arial",e){case"flag":return!c([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])&&(!c([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!c([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]));case"emoji":return!c([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}function d(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(i=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},o=0;o
Apr 18, 2019
24 Views
0

How to Disable Theme and Plugin Editors from WordPress Admin Panel

Written by

Did you know that WordPress comes with a built-in theme and plugin editor? This plain code editor allows you to edit your theme and plugin files directly from the WordPress dashboard. Now, this may sound really helpful, but it can also lead to issues such as breaking your site and potential security issues when combined with other vulnerabilities. In this article, we will explain why and how to disable theme and plugin editors from the WordPress admin area. Why Disable Theme and Plugin Editors in WordPress? WordPress comes with a built-in code editor which allows you to edit WordPress theme and plugin files…

Did you know that WordPress comes with a built-in theme and plugin editor? This plain code editor allows you to edit your theme and plugin files directly from the WordPress dashboard.

Now, this may sound really helpful, but it can also lead to issues such as breaking your site and potential security issues when combined with other vulnerabilities.

In this article, we will explain why and how to disable theme and plugin editors from the WordPress admin area.

Disable theme and plugin editors in WordPress admin area

Why Disable Theme and Plugin Editors in WordPress?

WordPress comes with a built-in code editor which allows you to edit WordPress theme and plugin files directly from the admin area.

The theme editor is located at Appearance » Theme Editor page. By default, it will show your currently active theme’s files.

Theme editor in WordPress

Similarly, the plugin editor can be seen at Plugins » Plugin Editor page. By default, it will show you one of the installed plugins from your site that comes up first in the alphabatical order.

Plugin editor in WordPress

If you visit the theme or plugin editor page for the first time, WordPress will warn you that using the editor can break your website.

Theme editor warning in WordPress

In WordPress 4.9, theme and plugin editors were upgraded to protect users from accidentally breaking their website. In most cases, the editor will catch a fatal error and will revert back the changes.

However, this is not guaranteed and some code may still slip through and you would end up losing access to the WordPress admin area.

The biggest problem with the built-in file editor is that it gives full access to add any kind of code to your website.

If a hacker broke into your WordPress admin area, then they can use the built-in editor to gain access to all your WordPress data.

Hackers can also use it to distribute malware or launch DDOS attacks from your WordPress website.

To improve WordPress security, we recommend removing the built-in file editors completely.

That being said, let’s see how to easily disable theme and plugin editors in WordPress.

How to Disable Theme and Plugin Editors in WordPress

Disabling theme and plugin editors in WordPress is quite easy.

Simply edit your wp-config.php file and paste the following code just before the line that says ‘That’s all, stop editing! Happy publishing’ :

define( 'DISALLOW_FILE_EDIT', true );

You can now save your changes and upload the file back to your website.

That’s all, plugin and theme editors will now disappear from themes and plugins menus in the WordPress admin area.

You can also add this line of code to your theme’s functions.php file, a site-specific plugin, or by using the code snippets plugin.

If you don’t want to edit the files directly, then you can install the Sucuri WordPress plugin which offers 1-click hardening feature.

Proper Way to Edit WordPress Theme and Plugin Files

Many users actually use WordPress theme and plugin editors to look up the code, add custom CSS, or editing code in their child themes.

If you only want to add custom CSS to your theme, then you can do so by using the theme customizer located under Appearance » Customize.

Adding custom CSS via theme customizer

For more details, see our guide on how to add custom CSS in WordPress without breaking your site.

If you want to look up the code in a plugin, then you can do so by using an FTP client.

For better file management and syntax highlighting, you can use one of these code editors for editing WordPress files on your computer.

Last but not least, you can also create a custom WordPress theme without writing any code.

We hope this article helped you learn how to easily disable theme and plugin editors from WordPress admin panel. You may also want to see our ultimate guide to improving WordPress performance and speed.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Disable Theme and Plugin Editors from WordPress Admin Panel appeared first on WPBeginner.

Article Categories:
Tutorials

Leave a Reply

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

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc a odio nec justo rutrum faucibus.
$20
Buy Now