其存储库中有超过 50,000 个插件,很明显WordPress 插件是任何WordPress网站的基本元素。您很可能已经测试并尝试使用其中的许多来解决问题或完成任务。如果您决定不再使用它,或者它不能按预期工作,您可以将其停用,然后从您的 WP 仪表板中删除。
但是,这不会删除 WP 插件的所有痕迹,并会在 WP 数据库中留下行和表。
最有可能存储数据的插件包括表单、缓存、安全和SEO 插件(SEO plugins)。在继续之前,请务必备份您的网站,以防出现问题。
随着时间的推移,这些插件痕迹会占用磁盘空间并影响您网站的性能。本文将向您展示如何删除 WP 插件以及所有相关文件。
从仪表板中删除 WordPress 插件(Remove the WordPress Plugin From The Dashboard)
- 登录(Log)到您的 WP 仪表板并导航到Installed Plugins。
- 单击插件下的 停用。(Deactivate )
通过 FTP 删除插件(Delete Plugin Via FTP)
- 插件也可以通过FTP卸载。连接(Connect)到FTP客户端,例如FileZilla、WinSCP或 Free FTP。导航(Navigate)到/wp-content/ folder。
- 找到要删除的插件,并通过删除其文件夹将其从服务器中删除。
使用 FTP 删除剩余文件(Use FTP to Remove Leftover Files)
WP 将相关的插件文件保存在唯一的文件夹中。您可以使用FileZilla等(FileZilla)FTP客户端删除这些文件。
- (Login)通过FTP登录并通过以下路径导航到插件文件夹:public_html > wp-contents > plugins以查看每个插件的文件夹。
- 如果您不认识目录中插件的名称,请返回您的 WP 仪表板插件选项卡以验证您正在删除正确的插件。
- 右键单击(Right-click)插件的名称,然后单击Delete。
从数据库中删除孤立表(Remove Orphaned Tables from Your Database)
许多 WP 插件创建自己的表并将这些信息添加到您的数据库中。当您卸载插件时,通常会留下一些或全部这些表,并被称为孤立表。
有两种方法可以删除这些表。最简单的是使用插件。
使用 WP 优化(Use WP-Optimize)
WP-Optimize将从您的数据库中清理并删除未使用的数据。
- 首先安装并激活插件。
- 在 WP 仪表板中找到(Locate)并打开 WP-Optimize 选项卡。
- 单击优化数据库表(Optimize database tables)设置。
- 要一次运行所有优化,勾选优化左侧的框以全(Optimization )选,然后单击蓝色按钮Run all selected optimizations。
- 或者,您可以选择单独运行每一项。一次运行将花费更少的时间。该过程完成后,您将看到消息优化完成(Optimization complete)。
手动删除孤立表(Delete Orphaned Tables Manually)
不要尝试这种方法,除非您有经验且能熟练地编辑数据库。您不想删除与要卸载的插件无关的表。
- 要手动删除孤立表,请使用phpMyAdmin等工具。大多数主机控制面板都可以让您访问此工具。
- 在 phpMyAdmin 中,使用顶部的搜索功能查找要清理的数据库。
- 搜索包含插件名称的条目名称。例如,如果您想卸载Yoast SEO,插件的文档(plugin’s documentation)会告诉您在搜索选项卡中输入wpseo以查找与该插件相关的所有条目。
- 选择(Choose)搜索中出现的所有表,然后单击Go。
使用 WP 插件删除插件相关文件(Use WP Plugins to Remove Plugin Associated Files)
一些免费和高级的 WP 插件将轻松清理您的数据库。 以下(Below)是其中的一些。
插件垃圾收集器(Plugins Garbage Collector)
插件垃圾收集器(Plugins Garbage Collector)将扫描并检查您的 WP 数据库以显示您在 WP 仪表板中看不到的表格。
- 安装并激活插件。
- 在“工具(Tools)”选项卡下查看其设置。
- 选择Search non-WP tables选项并点击Scan。
- 上面屏幕截图中的红色条目属于已停用或删除的插件。检查这些表并删除它们。
WP-优化(WP-Optimize)
WP-Optimize拥有超过 600,000 次活动安装,是最受欢迎的 WP 数据库优化插件之一。
单击运行(Click Run)优化以清理所需的选项。在表格(Table)信息选项卡中查看表格及其大小。您还可以在“设置”(Settings)选项卡下安排优化。
WP-扫描(WP-Sweep)
WP-Sweep是另一个 WP 插件,它将清理数据库中不必要的数据,包括孤立的插件数据和表格。
安装并激活插件后,转到Tools > Sweep访问设置。插件界面显示数据库中不必要的数据。
有评论、用户、术语、帖子、选项和优化表的部分。要优化您的数据库,请单击条目旁边的Sweep 。
WP-Sweep 使用 WP 删除功能来清理您的数据库。这可确保不会留下孤立数据。
删除未使用的简码(Remove Unused Shortcodes)
WP 有许多使用您在页面和帖子中插入的简码的插件。当您停用插件时,短代码将保留并显示为括号中的文本给查看者。
一种选择是手动从站点上的每个实例中删除快捷方式。但是,这可能需要很长时间。下面概述了其他更省时和实用的选择。
隐藏简码(Hide the Shortcode)
要从已删除的插件中隐藏剩余的短代码,请将以下内容添加到您的 functions.php 文件中:
// Remove shortcode
代码 add_shortcode( 'name_of_shortcode', '__return_false' );(add_shortcode( ‘name_of_shortcode’, ‘__return_false’ );)
使用 WP 插件删除孤立的简码(Use WP Plugin Remove Orphan Shortcodes)
如果您不习惯编辑 WP 文件,请使用Remove Orphan Shortcodes插件。
此插件会自动从您的内容中隐藏以前与插件和主题一起使用的孤立(非活动)短代码。
从您的 WP 仪表板卸载插件非常简单。但是,正如您现在所知,停用和删除插件并不总是会删除与其关联的所有文件和WordPress 数据库。(WordPress databases)
下次您想删除 WP 插件时,请按照上述步骤从数据库中删除不需要的文件,并维护一个快速、干净的 WP 站点。
How to Remove all Traces of a WordPress Plugin
With over 50,000 pluginѕ in its repository, it’s сlear that WordPress plυgins are an essential element to any WordPress site. You have most likely tested and tried to use many of them to solve problems or accompliѕh tasks. If you decide you don’t want to use it anymore or it doesn’t work as you expected, you deactivate and then delete it from your WP dashboard.
However, this does not remove all traces of a WP plugin and leaves behind rows and tables in your WP database.
The plugins that are most likely to store data include form, caching, security, and SEO plugins. Before proceeding, be sure to backup your website in case something goes wrong.
Over time, these plugins traces will take up disk space and affect your site’s performance. This article will show you how to remove a WP plugin along with all associated files.
Remove the WordPress Plugin From The Dashboard
- Log into your WP dashboard and navigate to Installed Plugins.
- Click on Deactivate under the plugin.
Delete Plugin Via FTP
- Plugins can also be uninstalled via FTP. Connect to an FTP client such as FileZilla, WinSCP, or Free FTP. Navigate to the /wp-content/ folder.
- Find the plugin you want to remove and delete it from your server by removing its folder.
Use FTP to Remove Leftover Files
WP keeps related plugin files in unique folders. You can remove these files with an FTP client such as FileZilla.
- Login via FTP and navigate to the plugins folder by the following path: public_html > wp-contents > plugins to see the folders for each plugin.
- If you don’t recognize the name of the plugin in the directory, go back to your WP dashboard plugins tab to verify you are deleting the correct plugin.
- Right-click on the name of the plugin and click Delete.
Remove Orphaned Tables from Your Database
Many WP plugins create their own tables and add this information to your database. Some or all these tables are often left behind when you uninstall a plugin and are referred to as orphaned.
There are two methods to remove these tables. The easiest is to use a plugin.
Use WP-Optimize
WP-Optimize will clean up and remove unused data from your database.
- Start by installing and activating the plugin.
- Locate and open the WP-Optimize tab in your WP dashboard.
- Click on the Optimize database tables setting.
- To run all optimizations at once, tick off the box to the left of Optimization to select all and then click the blue button Run all selected optimizations.
- Or, you can choose to run each one separately. Running all at once will take less time. When the process is done, you will see the message Optimization complete.
Delete Orphaned Tables Manually
Don’t attempt this method unless you are experienced and comfortable editing databases. You don’t want to delete tables that are not related to the plugin you are uninstalling.
- To delete orphaned tables manually, use a tool such as phpMyAdmin. Most hosting control panels will give you access to this tool.
- From phpMyAdmin, use the search function at the top to find the database you want to clean up.
- Search for names of entries that include the plugin’s name. For example, if you want to uninstall Yoast SEO, the plugin’s documentation tells you input wpseo into the search tab to find all entries related to the plugin.
- Choose all the tables that come up in the search and click Go.
Use WP Plugins to Remove Plugin Associated Files
Some free and premium WP plugins will clean up your database with minimal effort. Below are a few of them.
Plugins Garbage Collector
Plugins Garbage Collector will scan and check your WP database to show the tables you can’t see in your WP dashboard.
- Install and activate the plugin.
- Look under the Tools tab for its settings.
- Choose the Search non-WP tables option and click Scan.
- The entries in red in the screenshot above belong to plugins that have deactivated or deleted. Check off these tables and delete them.
WP-Optimize
WP-Optimize has over 600,000 active installations and is one of the most popular of the WP database optimization plugins.
Click Run optimization to clean up the options you want. See the tables and their size in the Table information tab. You can also schedule the optimizations under the Settings tab.
WP-Sweep
WP-Sweep is another WP plugin that will clean up unnecessary data in your database, including orphaned plugin data and tables.
After you install and activate the plugin, access the settings by going to Tools > Sweep. The plugin interface shows unnecessary data in your database.
There are sections for comments, users, terms, posts, options, and optimizing tables. To optimize your database, click Sweep next to the entry.
WP-Sweep uses WP delete functions to clean up your database. This ensures that orphaned data isn’t left behind.
Remove Unused Shortcodes
WP has many plugins that use shortcodes that you insert on pages and posts. When you deactivate the plugin, the shortcode remains and shows as text in brackets to viewers.
One option is to remove the shortcut from every instance on your site manually. However, this can take a long time. Other more time-effective and practical options are outlined below.
Hide the Shortcode
To hide a shortcode leftover from a deleted plugin, add the following to your functions.php file:
// Remove shortcode
add_shortcode( ‘name_of_shortcode’, ‘__return_false’ );
Use WP Plugin Remove Orphan Shortcodes
If you aren’t comfortable editing WP files, use the Remove Orphan Shortcodes plugin.
This plugin automatically hides orphan (inactive) shortcodes from your content that were previously used with plugins and themes.
Uninstalling plugins from your WP dashboard is simple and easy. However, as you now know, deactivating and deleting plugins doesn’t always remove all files and WordPress databases associated with them.
Next time you want to delete a WP plugin, follow the steps above to rid your database of the unwanted files and maintain a fast and clean WP site.