Dealing with terms is known to be very heavy operation.
The common tweak recommended is to use wp_defer_term_counting()
to temporarily disable updating of terms count (which is stored persistently in database and so must be updated when you change terms).
Related Posts:
- How to mass delete one line from all posts
- How do I limit the status options for bulk/quick edit to only Published and Draft?
- How to hook in to bulk trash posts
- how to edit title of bulk posts?
- Added new bulk action, but only work on bottom dropdown
- Modify wording of bulk options
- Bulk delete users by role? SQL?
- ex-style bulk post editing
- Bulk update status of all posts or pages on a particular path
- Custom bulk page permissions
- How do I assign a custom post to all terms in a custom taxonomy?
- Is There a Difference Between Taxonomies and Categories?
- How to show a hierarchical terms list?
- Show all terms of a custom taxonomy?
- How to get a taxonomy term name by the slug?
- Explanation of update_post_(meta/term)_cache
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- How can I get only parent terms?
- get_terms by custom post type
- Optimize post insert and delete for bulk operations?
- Need a simple but complete example of adding metabox to taxonomy
- Retrieve posts by term id custom query
- Get terms by taxonomy AND post_type
- Change order of Custom Taxonomy List
- Get the the top-level parent of a custom taxonomy term
- get_the_term_list without links in 3.1
- Inserting terms in an Hierarchical Taxonomy
- get_terms – only top level
- Custom bulk_action
- What is ‘term_group’ for ‘order_by’ in get_terms()?
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Get The Post Type A Taxonomy Is Attached To
- How to only list the child terms of a taxonomy and not their parents?
- Is there a downside of using wp_defer_term_counting?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Hierarchical taxonomy UI
- Order get_terms by term meta
- How to prevent new terms being added to a custom taxonomy?
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- Woocommerce get cart total price in a number format [closed]
- Display current taxonomy term when inside custom post type
- Display all the subcategories from a specific category?
- wp set object terms vs wp set post terms
- Get term slug of current post
- tax_query in get_posts() not working?
- Get parent id by term id
- Order get_terms using a Custom Field
- How to get_term_children output in alphabetical order?
- Show posts without term
- When to / not to use wp_get_post_terms vs get_the_terms?
- get_term_children for immediate children only (not grandchildren)
- get_terms vs. get_categories: does it matter?
- Query users by custom taxonomy and user role
- Woocommerce get category image full size
- What is wp_insert_term “alias_of” arg for?
- Automatically Assign Parent Terms When A Child Term is Selected
- Getting a taxonomy’s thumbnail url
- Get Terms by IDs with IDs order
- wp_list_tables bulk actions
- Determine Term depth
- How to get current term in my custom taxonomy in WordPress?
- Is there a way to ‘Lock’ a Taxonomy?
- Display Category Thumbnail and links in Woo commerce
- Order get_terms() By Custom Field
- Control term order on a per-post basis
- Bulk term assignment for attachment taxonomies
- Hide the term description on the term edit page, for a given taxonomy
- Passing a hardcoded page/post ID into `get_post`
- MySQL Query to Retrieve Category from wp_posts
- How to implement bulk actions in my plugin?
- get term by id without taxonomy
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- Order terms by term_order
- get_term_by not working when in functions.php
- Fixing category count
- How to limit the number of terms (terms acts like categories)
- Creating a non-removable taxonomy term
- Get value in custom field with taxonomy [closed]
- Why does WordPress combine a term with the same name in the wp_terms table?
- Get second level terms of custom taxonomy
- WordPress 4.4+ breaks Walker Extension
- What is the difference between terms and tags?
- Can I lock down custom taxonomies on a parent term level, but not a child term?
- Slow wp_term_relationships query
- How do I list custom taxonomy terms without the links?
- How can I get category ID by category name?
- query multiple taxonomies
- WP-CLI Bulk delete posts from specific category
- wp_set_object_terms() is not replacing term, but creating a new one
- get a specific taxonomy term name
- Correct use of get_the_terms()
- Get only the first term by taxonomy
- Exclude specific slug in ‘get_terms’
- Large taxonomy (2000+ terms), causing WordPress to hang
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query
- Get terms that contain posts that in turn belong to other terms?
- Custom order of terms for custom taxonomy in admin and website
- wp_set_object_terms() Fails to Set Terms