WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to export post from particular category id from phpmyadmin? (2 posts)

  1. ApnaySMS
    Member
    Posted 4 years ago #

    How to export post from particular category id from phpmyadmin?
    i tried this query

    SELECT * FROMwp_postsWHERE 'cat_id' LIKE 38
    but its not working

  2. vtxyzzy
    Member
    Posted 4 years ago #

    Use the query below;

    SELECT * FROM wp_posts p
    JOIN wp_term_relationships tr
       ON (p.ID = tr.object_id)
    JOIN wp_term_taxonomy tt
       ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy='category')
    JOIN wp_terms t
       ON (t.term_id = tt.term_id AND t.term_id = 38)
    WHERE 1=1
    AND p.post_type = 'post'
    AND p.post_status = 'publish'

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags