WORDPRESS查询没有添加文章标签的文章ID
  • 分类:Wordpress
  • 发表:2022-02-21
  • 围观(459)
  • 评论(0)

为了查询哪些文章没有添加文章标签可以用以下查询语句查询文章ID

select id from wp_posts where id not in (select object_id FROM wp_term_relationships where wp_term_relationships.term_taxonomy_id in(select wp_term_taxonomy.term_taxonomy_id from wp_term_taxonomy where wp_term_taxonomy.taxonomy = 'post_tag' )) and wp_posts.post_type='post' and wp_posts.post_status='publish'

Top