
WordPress 编辑插件
您知道 WordPress 带有内置主题和插件编辑器吗?这个纯代码编辑器允许您直接从 WordPress 仪表板编辑主题和插件文件。
您知道 WordPress 带有内置主题和插件编辑器吗?这个纯代码编辑器允许您直接从 WordPress 仪表板编辑主题和插件文件。
现在,这可能听起来确实很有帮助,但它也可能导致问题,例如破坏您的网站以及与其他漏洞结合使用时潜在的安全问题。
现在,这听起来确实很有帮助,但当与其他漏洞结合使用时,它也可能导致诸如站点受损和潜在安全问题等问题。
在本文中,我们将解释为什么以及如何从 WordPress 管理区域禁用主题和插件编辑器。
在本文中,我们将解释为什么以及如何从 WordPress 管理区域禁用主题和插件编辑器。

为什么要在WordPress中禁用主题和插件编辑器? (Why Disable Theme and Plugin Editors in WordPress?)
WordPress 附带一个内置代码编辑器,允许您直接从管理区域编辑 WordPress 主题和插件文件。
WordPress 附带一个内置代码编辑器,允许您直接从管理区域编辑 WordPress 主题和插件文件。
The theme editor is located at 外观 » 主题编辑器 page. By default, it will show your currently active theme’s files.
主题编辑器位于外观 » 主题编辑器页面。 默认情况下,它将显示您当前活动的主题的文件。

Similarly, the plugin editor can be seen at 插件 » 插件编辑器 page. By default, it will show you one of the installed plugins from your site that comes up first in the alphabatical order.
同样,可以在“ 插件 »插件编辑器”页面上看到插件编辑器 。 默认情况下,它将向您显示站点中已安装的插件中的一个,并按字母顺序顺序显示。

如果您第一次访问主题或插件编辑器页面,WordPress 会警告您使用编辑器可能会破坏您的网站。
如果您第一次访问主题或插件编辑器页面,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.
在WordPress 4.9 ,主题和插件编辑器已升级,以保护用户避免意外破坏其网站。 在大多数情况下,编辑器将捕获一个致命错误,并将还原所做的更改。
However, this is not guaranteed and some code may still slip through and you would end up 无法访问 WordPress 管理区域.
但是,这不能保证,某些代码可能仍然会漏掉,最终您将无法访问 WordPress 管理区域 。
内置文件编辑器的最大问题是它提供了向您的网站添加任何类型的代码的完全访问权限。
内置文件编辑器的最大问题是它具有向您的网站添加任何类型的代码的完全访问权限。
如果黑客闯入您的 WordPress 管理区域,那么他们可以使用内置编辑器来访问您的所有 WordPress 数据。
如果黑客闯入您的 WordPress 管理区域,那么他们可以使用内置编辑器访问您的所有 WordPress 数据。
Hackers can also use it to distribute malware or launch DDOS 攻击 from your WordPress website.
黑客还可以使用它来分发恶意软件或从您的WordPress网站发起DDOS攻击 。
To improve WordPress 安全, we recommend removing the built-in file editors completely.
为了提高WordPress 安全 ,我们建议完全删除内置文件编辑器。
话虽这么说,让我们看看如何轻松禁用 WordPress 中的主题和插件编辑器。
话虽如此,让我们看看如何轻松禁用 WordPress 中的主题和插件编辑器。
如何在WordPress中禁用主题和插件编辑器 (How to Disable Theme and Plugin Editors in WordPress)
在 WordPress 中禁用主题和插件编辑器非常简单。
在 WordPress 中禁用主题和插件编辑器非常容易。
Simply edit your wp-config.php 文件 and paste the following code just before the line that says ‘就这样吧,别再编辑了!快乐出版” :
只需编辑您的wp-config.php 文件 ,并将以下代码粘贴在“就这样了,别再编辑了! 快乐出版 :
define( 'DISALLOW_FILE_EDIT', true );
您现在可以保存更改并将文件上传回您的网站。
您现在可以保存更改并将文件上传回您的网站。
就这样,插件和主题编辑器现在将从 WordPress 管理区域的主题和插件菜单中消失。
就是这样,插件和主题编辑器现在将从 WordPress 管理区域的主题和插件菜单中消失。
You can also add this line of code to your theme’s 函数.php file, a 特定于站点的插件, or by using the 代码片段 plugin.
您还可以将这行代码添加到主题的函数.php文件( 具体的于网站插件) ,或使用代码片段插件添加。
If you don’t want to edit the files directly, then you can install the 苏库里 WordPress plugin which offers 1-click hardening feature.
如果您不想直接编辑文件,则可以安装提供一键式强化功能的苏库里 WordPress插件。
编辑WordPress主题和插件文件的正确方法 (Proper Way to Edit WordPress Theme and Plugin Files)
许多用户实际上使用 WordPress 主题和插件编辑器来查找代码、添加自定义 CSS 或在子主题中编辑代码。
许多用户实际上使用 WordPress 主题和插件编辑器来查找代码、添加自定义 CSS 或在子主题中编辑代码。
If you only want to add custom CSS to your theme, then you can do so by using the theme customizer located under 外观 » 定制.
如果只想向主题添加自定义CSS,则可以使用外观 » 定制下的主题定制器来进行。

For more details, see our guide on 如何在 WordPress 中添加自定义 CSS without breaking your site.
有关更多详细信息,请参见有关如何在 WordPress 中添加自定义 CSS而不破坏您的网站的指南。
If you want to look up the code in a plugin, then you can do so by 使用 FTP 客户端.
如果您想在插件中查找代码,则可以使用 FTP 客户端进行查找。
For better file management and syntax highlighting, you can use one of these 用于编辑 WordPress 文件的代码编辑器 on your computer.
为了更好的文件管理和语法突出显示,您可以使用以下要编辑的代码编辑器之一计算机上的WordPress 文件 。
Last but not least, you can also 创建自定义 WordPress 主题 without writing any code.
最后但并非最不重要的一点是,您也可以创建自定义 WordPress 主题而无需编写任何代码。
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 性能和速度.
我们希望本文能帮助您学习如何从WordPress管理面板轻松禁用主题和插件编辑器。 您可能还想看看我们有关提高WordPress 性能和速度最终指南。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和Facebook上找到我们。
WordPress 编辑插件