It’s definitely possible, I believe you are on the right track.
You might wanna add a check if a post already exists with this title, because you’re likely to run into some PHP timeout issues with your script. That way you can run the script several times and create all the posts.
You can use the post_exists()
function for this:
if( post_exists( $term->name ) ){
continue;
} else {
wp_insert_post($args);
}
Related Posts:
- How do I append multiple taxonomies to the URL?
- Creating “static” taxonomies to choose from, inside custom post type?
- Custom Post Type with Custom Title
- changing meta value and meta key of price field
- WooCommerce sort products by the actual product width(not the shipping width)
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Redirect to another page using contact form 7? [closed]
- Problems making shortcode with custom post types and taxonomy
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Question about link two types of data in wordpress
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Set a Default CPT taxonomy by taxonomy id
- Custom Taxonomy is disabled on Edit page
- Sort by Custom Post Type (Multiple Loop)
- Query multiple post of which one by taxonomy
- Issue On Listing Woocommerce Parent Tag List
- Order By Post Type ThenBy Taxonomy
- How to show CPTs in term archive
- Custom query to filter posts that have current post as a taxonomy [closed]
- How do I get array of types associated with a taxonomy?
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- Group posts by custom post type
- Tag page with Custom Post Types not returning any posts
- Custom Page that comes with preloaded content for the user
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Display all posts in main category and 1 subcategory
- How to display product subcategories into my custom post type single page
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- Update permalinks when new category added to custom post type taxonomy
- Show category ID on custom post type
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- How to check post type (to include custom css)
- How to customize a permalink (URL) structure?
- Get post from custom post type order by two taxonomies
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- Custom Taxonomies not appearing in Admin
- How to Mass Delete Images from Media Library
- Custom Post Type Set Comments ON by default without show METABOX
- Custom Post Type Taxonomy Filters
- How do I do this with WordPress? Taxonomies?
- Permalink structure by Post Meta value
- How to integrate video slide using custom post types?
- Is using taxonomies the way to go here or would custom post types be better?
- Using default WP menu functionality to link to custom post-type listing?
- Can taxonomies of custom post types be used with category actions?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- Custom Taxonomy back-end customizations
- How to allow visitors to enter custom post type?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- Taxonomy custom post type URL
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- WordPress sort search results by custom order
- How to Filter custom post type by taxonomy?
- Is it possible to have dedicated page for parent/child taxonomy?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- Custom post taxonomies as tax_query terms?
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- Woocommerce search pagination not working
- WooCommerce Customer Role Delete Custom Post Type
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- Manage custom post type in woocommerce /my-account/ page
- Get product variation attribute titles – WooCommerce
- Show child custom post types list inside single parent custom post type
- limit value taxonomy based on previous taxonomy value wordpress
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Several post types on WP Query by tag and taxonomy
- Default text in a specific post type, but not visible?
- Woocommerce custom field search in custom post type [closed]
- Using meta_query and tax_query at the same time
- Update postmeta Parent when post_status child change
- How do I display the taxonomy for a custom post type in an array
- Set a CPT slug as a base name for all the taxonomies
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- WP_Query custom post type query not showing the exact post type