sql 用于禁用现有WordPress页面,帖子和自定义帖子类型的注释,引用和pingback的SQL命令。默认的WordPress

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 用于禁用现有WordPress页面,帖子和自定义帖子类型的注释,引用和pingback的SQL命令。默认的WordPress相关的知识,希望对你有一定的参考价值。

/* Core */
/* If post_status=publish and post_type=page/post: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'page';
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';

/* If post_status=draft and post_type=page/post: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'page';
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'post';

/* If post_status=private and post_type=page/post: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'private' AND post_type = 'page';
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'private' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'private' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'private' AND post_type = 'post';

/* If post_status=auto-draft and post_type=page/post: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'auto-draft' AND post_type = 'page';
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'auto-draft' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'auto-draft' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'auto-draft' AND post_type = 'post';

/* If post_status=pending and post_type=page: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'pending' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'pending' AND post_type = 'page';

/* If post_status=trash and post_type=page: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'trash' AND post_type = 'page';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'trash' AND post_type = 'page';

/* If post_status=pending and post_type=post: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'pending' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'pending' AND post_type = 'post';

/* If post_status=inherit and post_type=revision: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'inherit' AND post_type = 'revision';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'inherit' AND post_type = 'revision';

/* If post_status=inherit and post_type=attachment: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'inherit' AND post_type = 'attachment';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'inherit' AND post_type = 'attachment';

/* If post_status=private and post_type=attachment: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'private' AND post_type = 'attachment';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'private' AND post_type = 'attachment';

/* If post_status=publish and post_type=nav_menu_item: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'nav_menu_item';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'nav_menu_item';

/* If post_status=draft and post_type=nav_menu_item: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'nav_menu_item';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'nav_menu_item';

/* Contact Form 7 */
/* If post_status=publish and post_type=wpcf7_contact_form: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'wpcf7_contact_form';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'wpcf7_contact_form';

/* Events Manager */
/* If post_status=publish and post_type=location: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'location';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'location';

/* Easy Testimonials */
/* If post_status=publish and post_type=testimonial: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'testimonial';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'testimonial';

/* Event Organiser */
/* If post_status=publish and post_type=event: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'event';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'event';

/* If post_status=draft and post_type=event: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'event';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'event';

/* If post_status=trash and post_type=event: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'trash' AND post_type = 'event';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'trash' AND post_type = 'event';

/* If post_status=publish and post_type=eo_booking_form: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'eo_booking_form';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'eo_booking_form';

/* If post_status=confirmed and post_type=eo_booking: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'confirmed' AND post_type = 'eo_booking';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'confirmed' AND post_type = 'eo_booking';

/* If post_status=pending and post_type=eo_booking: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'pending' AND post_type = 'eo_booking';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'pending' AND post_type = 'eo_booking';

/* If post_status=cancelled and post_type=eo_booking: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'cancelled' AND post_type = 'eo_booking';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'cancelled' AND post_type = 'eo_booking';

/* My Calendar */
/* If post_status=publish and post_type=mc-events: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'mc-events';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'mc-events';

/* NextGEN Gallery */
/* If post_status=draft and post_type=gal_display_source: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'gal_display_source';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'gal_display_source';

/* If post_status=draft and post_type=lightbox_library: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'lightbox_library';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'lightbox_library';

/* If post_status=draft and post_type=display_type: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'display_type';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'display_type';

/* If post_status=draft and post_type=displayed_gallery: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'displayed_gallery';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'displayed_gallery';

/* If post_status=draft and post_type=ngg_gallery: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_gallery';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_gallery';

/* If post_status=draft and post_type=ngg_pictures: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_pictures';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_pictures';

/* If post_status=draft and post_type=ngg_album: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_album';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'ngg_album';

/* SlideDeck 2 */
/* If post_status=publish and post_type=sd2_custom_slide: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'sd2_custom_slide';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'sd2_custom_slide';

/* WooCommerce */
/* If post_status=publish and post_type=product: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'product';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'product';

/* If post_status=draft and post_type=product: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'draft' AND post_type = 'product';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'draft' AND post_type = 'product';

/* If post_status=wc-cancelled and post_type=shop_order: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'wc-cancelled' AND post_type = 'shop_order';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'wc-cancelled' AND post_type = 'shop_order';

/* If post_status=wc-failed and post_type=shop_order: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'wc-failed' AND post_type = 'shop_order';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'wc-failed' AND post_type = 'shop_order';

/* If post_status=publish and post_type=product_variation: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'product_variation';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'product_variation';

/* If post_status=private and post_type=product_variation: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'private' AND post_type = 'product_variation';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'private' AND post_type = 'product_variation';

/* Custom Post Types */
/* If post_status=publish and post_type=POST_TYPE: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'POST_TYPE';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'POST_TYPE';

/* Elegant Themes */
/* Divi */
/* If post_status=publish and post_type=et_pb_layout: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'et_pb_layout';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'et_pb_layout';

/* Evolution */
/* If post_status=publish and post_type=feedback: */
UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'feedback';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'feedback';

以上是关于sql 用于禁用现有WordPress页面,帖子和自定义帖子类型的注释,引用和pingback的SQL命令。默认的WordPress的主要内容,如果未能解决你的问题,请参考以下文章

Wordpress 在特定页面/帖子上禁用插件

用于解析现有帖子的Wordpress方法

sql 通过这个简单的MySQL查询禁用WordPress帖子的所有注释。

WordPress 搜索仅适用于帖子,不适用于页面

sql SQL:将WordPress页面更改为帖子

sql SQL:将WordPress帖子更改为页面