Last active
August 29, 2015 13:58
-
-
Save lswilson/9938267 to your computer and use it in GitHub Desktop.
WordPress: SQL to migrate posts from a single category to its own custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_posts | |
inner join wp_term_relationships rel on wp_posts.id=rel.object_id | |
inner join wp_term_taxonomy tax on rel.term_taxonomy_id=tax.term_taxonomy_id | |
inner join wp_terms term on tax.term_id=term.term_id | |
set wp_posts.post_type='your_post_type' | |
WHERE | |
term.slug="category_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist was justly gisted.