[wordpress插件] Custom Post Type Cleanup自定义帖子类型清除

wordpress 插件 文章 2020-04-09 05:00 0 216 全屏看文
评分
100
描述

Custom post type posts are left in the database if a post type is no longer registered (in use).

如果不再注册(使用中)帖子类型,则将自定义帖子类型帖子保留在数据库中。

Plugins and themes can (without you knowing) use custom post types as a way to store data.

插件和主题可以(不知道)使用自定义帖子类型作为存储数据的方式。

These posts stay in the database forever if they’re not cleaned up by the plugin/theme itself upon deletion.

如果这些帖子在删除后未被插件/主题本身清除,则将永久保留在数据库中。

There are a lot of plugins that clean your database (by removing revisions, drafts etc.), but I haven’t found one that does a cleanup of unused post type posts.

有很多插件可以清理您的数据库(通过删除修订版,草稿等),但是我还没有找到可以清除未使用的帖子类型帖子的插件。

This plugin provides an easy way to detect and remove posts from post types that are no longer in use.

此插件提供了一种简便的方法,可以从不再使用的帖子类型中检测和删除帖子。

The settings page for this plugin is at wp-admin > Tools > Custom Post Type Cleanup.

该插件的设置页面位于wp-admin>工具>自定义帖子类型清除。

Note: The proper WordPress delete function wp_delete_post

注意:正确的WordPress删除功能 wp_delete_post

is used instead of running a direct MySQL query to delete the posts.

用于代替运行直接的MySQL查询来删除帖子。

This way all associated post data (comments, post meta etc.) are also deleted from the database.

这样,所有关联的帖子数据(评论,帖子元等)也将从数据库中删除。

Since version 1.2.0 you can re-register unused custom post types for a limited period of time.

从1.2.0版开始,您可以在有限的时间内重新注册未使用的自定义帖子类型。

This allows you to inspect and delete the posts like you would normally (in the wp-admin).

这样一来,您可以像平常一样(在wp-admin中)检查和删除帖子。

安装步骤

Follow these instructions to install the plugin.

按照以下说明安装插件。

    1. In your WordPress admin panel, go to Plugins > New Plugin, search for “custom post type cleanup” and click “Install now”.
    2. 在WordPress管理面板中,转到“插件”>“新插件”,搜索“自定义帖子类型清理”,然后单击“立即安装”。

    3. Alternatively, download the plugin and upload the contents of custom-post-type-cleanup.zip to your plugins directory, which usually is /wp-content/plugins/.
    4. 或者,下载插件并将custom-post-type-cleanup.zip的内容上传到您的插件目录,该目录通常是/ wp-content / plugins/。
    5. Activate the plugin
    6. 激活插件

    7. Go to wp-admin > Tools > Custom Post Type Cleanup and see if there are unused custom post type posts in the database.
    8. 转到wp-admin>工具>自定义帖子类型清除,然后查看数据库中是否有未使用的自定义帖子类型帖子。

下载地址
https://downloads.wordpress.org/plugin/custom-post-type-cleanup.1.3.0.zip
-EOF-