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
- Add a post when another post type is inserting
- data-type=”” … needed post tags stripped of characters
- Is there something like has_no_term
- Get only used meta_values
- Getting the taxonomy
- Template files for Custom Post Type and Taxonomy
- Custom post types: change “read more” text
- How to automatically and randomly reorder custom post type?
- Get post_type by term_id
- Set templates for custom post types
- How to keep a CPT from being visible on the front end?
- Ascending Order is not Working in Custom Post Type Listining
- How can i display movies in profile page, added by an user?
- Add a ‘guide’ image to custom post type admin page
- wordpress remove views from action links in a custom post
- Creat new admin url for custom post type
- How to Create Template File for Parent Page of Custom Post Type
- List custom posts
- Understanding Post Formats/Custom Post types Etc
- Edit the_content() function so to add a div wrapper
- If Post Meta Equals Current Title Conditional Advanced Custom Fields
- Extracting Address from Custom Post via Javascript for Google Maps API
- Post-thumbnail only for specific post-types?
- Custom Post Types — $args vs. labels array
- Serial Number Delivery System Using WordPress
- Custom Field values not Showing in Edit Page of Custom Post Type
- the_post_thumbnail call removing li in code
- How to make WP_Query not to show irrelevant posts?
- Custom post type causes php-error in php version 5.2.17
- When should I create custom post types?
- in_category for custom post types
- publish_post action doesn’t work
- How do you create %post_type%/%postname%/ permalink structure?
- How do you make a custom post type items automatically delete items 3 months after publication?
- sort post types by amount of views
- Custom Post Type Dilema – How do I categorise by country?
- Creating my own portfolio custom-type