Custom post-type and taxonomy definitions are not saved to the database, and so registering them only makes WordPress “aware” of their existence for that page request. As custom post-type/taxonomy registration does not require database interaction, the performance impact is negligible. I’ve never actually seen any applications that selectively register CPTs/taxonomies (though I’m sure they’re out there).
Inspecting the problematic queries themselves should give you a good idea of what’s causing them. In this instance, they will likely point to your use of wp_insert_term()
, which attempts to insert all of those terms into the database on every page load. You should consider doing this one time only when your plugin is first activated by using an activation hook.
Related Posts:
- How to enqueue scripts on custom post add/edit pages?
- remove custom post type permalink
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Action hook on Edit custom post type?
- Unregister post type from child theme
- Custom post type save_post action not firing
- How to correctly get post type in a the_title filter
- How to intercept publish post for a custom post type “event”
- Why The Init Hook For Custom Post Types
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How to show more posts on an archive page?
- With what hook can I address all posts from all custom post types when they are published?
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Dynamically Create Terms in Taxonomy when Custom Post Type is Published. Almost There!
- WordPress Custom Shortcode Conflicting with Media Library
- WordPress custom post action hook
- action init hook and get_post_types
- Custom post type archive sorted and grouped by date in post meta field
- What hook should be used to programmatically create a post only when master post is updated?
- pre get posts changing the query
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Using pre_get_posts to Filter Posts
- Remove “Get Shortlink” button in admin of custom post type
- update_post_meta() whenever custom post type is updated
- How to get Custom Post ID by adding filter to child theme’s function
- Custom post_type search’s $wp_query->query_vars do not correspond
- Check Title Unique Or Not and If not error message and dont save
- Can’t unregister parent theme’s CPT from my child theme
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Displaying custom taxonomy in the admin list of a custom post type
- Can taxonomies of custom post types be used with category actions?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How do I add a custom screen for a custom post type to be called from custom post row action?
- Custom post type suppress transition from future to publish
- Filter Posts from the Main Query
- Using preg_replace to filter custom textarea
- Create new custom post and post category of same name
- Use remove_meta_box conditionally on custom post type
- Include php on a specific page template
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Running a wordpress action when a custom post type term (taxonomy category) is changed
- Types plugin custom post add_action hooks
- Loading plugin text domain before registering post type
- How can I get some of a posts meta data whilst it is still inserting?
- add_action ‘init’ from inside a class for custom post types
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Using `set_transient()` when saving a custom post type
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- Post Click Redirect to Custom URL instead of Single Post Page
- publish_post action callback not executed, why?
- How to store additional data that is related to core data
- Keep br tags from stripping
- do action inside a class is not working
- Filter wp_dropdown_categories Per Post Type
- What is the proper way implement a global $wp_rewrite?
- Dynamically change post_parent in every page load?
- Create action running on trashed_post hook to modify post_meta value
- Custom post type functions.php if statement on action
- Redirect after deleting post and keep track of pagination
- Permalinks in Custom Post types
- how to create my own edit.php admin page code or template for my custom post type
- Custom Post Type with Nested Taxonomy and Template Files
- Disable WordPress Recognizing Path as Attachment
- Rest Api v2 orderby meta_key in custom post type
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- When ‘is_post_type_archive()’ return true?
- How to check if “is single” page
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- Filtering WP_Query
- Custom post type – get_day_link()
- Get related posts of child term of custom post type
- CPT archive admin menu label
- Content Editable CPT Archive?
- How to define a term for custom taxonomy
- Removing full title and breadcrumb header container for a specific post type
- Using Pagination for Custom Post Type and keeps returning 404
- add post meta value
- rewriterule not working
- CPT Repeatable Fields + Undefined Index
- Calling a div and content in php?
- Multiple custom post types on same admin page
- Custom field only on custom post type?
- Insert a Custom Post type into my Loop
- add_action for save_post_{type} resulting in WSOD
- Using meta boxes as the title of a custom post type
- Custom Taxonomy not working front side Woocommerce
- How do i create user accounts from custom posts that have email addresses
- How to hide editor, but keep media library access
- Is it good practice to search for custom posts based on custom field values?
- Is it possible to create a separate page for custom posts gallery?
- Remove Permanent URL for custom post types
- Links in archive not including taxonomy parameter
- Get permalink in custom post type loop doesn’t work