• Hi, we have had problems that grew over time until we pin pointed them down to conflicting terms. Apparently our site never autosplit its shared terms when upgrading to WordPress 4.2+ and now it is causing major headaches for our writers.
    As soon as a category that has a shared term taxonomy has been selected, we are unable to publish or even save the post. And we can not edit nor delete the conflicting terms or tags either. Claims that we are not allowed to, even when we login with admin accounts.
    Read about the plugin wp_find_shared_terms to find and split existing terms, but that plugin doesn’t really give us any useful error messages other than confirm that we have plenty conflicting terms and are unable to split them.

        Splitting all shared terms
        ERROR: Term Taxonomy ID 3 could not be split!
        ERROR: Term Taxonomy ID 101 could not be split!
        ERROR: Term Taxonomy ID 37 could not be split!
        ERROR: Term Taxonomy ID 211 could not be split!
        ERROR: Term Taxonomy ID 47 could not be split!
        ERROR: Term Taxonomy ID 554 could not be split!
        ERROR: Term Taxonomy ID 556 could not be split!
        ERROR: Term Taxonomy ID 58 could not be split!
        ERROR: Term Taxonomy ID 61 could not be split!
        ERROR: Term Taxonomy ID 1870 could not be split!
        ERROR: Term Taxonomy ID 547 could not be split!
        ERROR: Term Taxonomy ID 71 could not be split!
        ERROR: Term Taxonomy ID 1868 could not be split!
        ERROR: Term Taxonomy ID 82 could not be split!
        ERROR: Term Taxonomy ID 549 could not be split!
        ERROR: Term Taxonomy ID 91 could not be split!
        ERROR: Term Taxonomy ID 555 could not be split!
        ERROR: Term Taxonomy ID 102 could not be split!
        ERROR: Term Taxonomy ID 540 could not be split!
        ERROR: Term Taxonomy ID 136 could not be split!
        ERROR: Term Taxonomy ID 175 could not be split!
        ERROR: Term Taxonomy ID 171 could not be split!
        ERROR: Term Taxonomy ID 841 could not be split!
        ERROR: Term Taxonomy ID 199 could not be split!
        ERROR: Term Taxonomy ID 583 could not be split!
        ERROR: Term Taxonomy ID 232 could not be split!
        ERROR: Term Taxonomy ID 564 could not be split!
        ERROR: Term Taxonomy ID 1880 could not be split!
        ERROR: Term Taxonomy ID 287 could not be split!
        ERROR: Term Taxonomy ID 1881 could not be split!
        ERROR: Term Taxonomy ID 289 could not be split!
        ERROR: Term Taxonomy ID 551 could not be split!
        ERROR: Term Taxonomy ID 379 could not be split!
        ERROR: Term Taxonomy ID 558 could not be split!
        ERROR: Term Taxonomy ID 497 could not be split!
        ERROR: Term Taxonomy ID 541 could not be split!
        ERROR: Term Taxonomy ID 590 could not be split!
        ERROR: Term Taxonomy ID 546 could not be split!
        ERROR: Term Taxonomy ID 1558 could not be split!
        ERROR: Term Taxonomy ID 565 could not be split!
        ERROR: Term Taxonomy ID 1789 could not be split!
        ERROR: Term Taxonomy ID 569 could not be split!
        ERROR: Term Taxonomy ID 899 could not be split!
        ERROR: Term Taxonomy ID 824 could not be split!
        ERROR: Term Taxonomy ID 828 could not be split!
        ERROR: Term Taxonomy ID 883 could not be split!
        ERROR: Term Taxonomy ID 903 could not be split!
        Process complete!
        Processed: 47
        Split: 0
        Skipped: 0
        Errors: 47

    There are 47 shared terms in your database. If you are running any plugins or themes that store term IDs, you may be affected by shared term splitting in WordPress 4.2+.

    I wonder what else we can do to solve this issue. Is there any server or database settings we are missing? Is there any other script that at least can give us some more useful error messages?

    Server and installation info:

    
    ### wp-core ###
    
    version: 5.2.4
    site_language: sv_SE
    user_language: sv_SE
    permalink: /%postname%/
    https_status: false
    user_registration: 1
    default_comment_status: open
    multisite: false
    user_count: 156
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_size: 346,41 MB (363233617 bytes)
    uploads_size: 7,38 GB (7928469973 bytes)
    themes_size: 31,68 MB (33223525 bytes)
    plugins_size: 97,06 MB (101772300 bytes)
    database_size: 117,39 MB (123092992 bytes)
    total_size: 7,96 GB (8549792407 bytes)
    
    ### wp-active-theme ###
    
    name: Zeen Child
    version: 2.3.1
    author: Codetipi
    author_website: (undefined)
    parent_theme: Zeen
    theme_features: title-tag, post-thumbnails, automatic-feed-links, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, sensei, post-formats, menus, html5, customize-selective-refresh-widgets, align-wide, widgets
    
    ### wp-themes (4) ###
    
    15Zine Child: version: 1.0, author: Codetipi
    15Zine: version: 3.2.2, author: Codetipi
    Ciola: version: 2.5, author: Cubell
    Zeen: version: 2.4.2, author: Codetipi
    
    ### wp-plugins-active (26) ###
    
    Akismet Anti-Spam: version: 4.1.2, author: Automattic
    Co-Authors Plus: version: 3.4, author: Mohammad Jangda, Daniel Bachhuber, Automattic
    Disqus for WordPress: version: 3.0.17, author: Disqus
    Easy Table: version: 1.8, author: Takien
    Envato Market: version: 2.0.3, author: Envato
    Event Organiser: version: 3.8.3, author: Stephen Harris
    Event Organiser Front End Submission: version: 1.3.2, author: Stephen Harris (latest version: 1.3.10)
    Event Organiser Posterboard: version: 3.0.1, author: Stephen Harris
    Event Organiser Pro: version: 1.10.4, author: Stephen Harris (latest version: 3.0.5)
    Find Shared Terms: version: 0.1.2, author: Josh Eaton
    Jetpack by WordPress.com: version: 7.8, author: Automattic
    Let's Info Up: version: 1.1.3, author: Codetipi
    Let's Live Blog: version: 1.1.1, author: Codetipi
    Let's Review: version: 3.0.5, author: Codetipi
    Let's Social Count: version: 1.1.3, author: Codetipi
    Login Logo: version: 0.9.0, author: Mark Jaquith
    Login With Ajax: version: 3.1.8.1, author: Marcus Sykes
    Related Posts By Taxonomy: version: 2.7.2, author: keesiemijer
    Simple Local Avatars: version: 2.1.1, author: Jake Goldman, 10up
    User Role Editor: version: 4.52, author: Vladimir Garagulya
    WM Simple Captcha: version: 2.0.3, author: webmumbai
    WP-Polls: version: 2.75.3, author: Lester 'GaMerZ' Chan
    WP Dashboard Notes: version: 1.0.9, author: Jeroen Sormani
    WP phpMyAdmin: version: 2.91, author: Puvox.software
    Yoast SEO: version: 12.3, author: Team Yoast
    Zeen Engine: version: 2.2.0, author: Codetipi
    
    ### wp-plugins-inactive (33) ###
    
    15Zine - Functionality: author: (undefined), version: 3.1
    AddQuicktag: version: 2.5.3, author: Frank Bültge
    AddToAny Share Buttons: version: 1.7.39, author: AddToAny
    Advanced Blog Metrics: version: 1.5, author: Atalanta
    bbPress: version: 2.5.14, author: The bbPress Community
    Board Game Geek Infos: version: 1.0.0, author: Giorgio Aquino
    BoardGamePrices: version: 1.1.4, author: Kean Pedersen
    Clean Up Zombie Users: version: 0.4f, author: Imperative Ideas
    Contact Form 7: version: 5.1.4, author: Takayuki Miyoshi
    Email Alerts: version: 1.2, author: Simon Wheatley
    Event Organiser Venue Markers: version: 1.0.2, author: Stephen Harris
    Facebook All: version: 1.8, author: sourceaddons
    Force Regenerate Thumbnails: version: 2.0.6, author: Pedro Elsner
    Fraktjakt Shipping Method for WooCommerce: version: 2.1.1, author: Fraktjakt AB (Sweden)
    Google AdSense: version: 1.2.1, author: Google
    Google Analyticator: version: 6.5.4, author: SumoMe
    Health Check & Troubleshooting: version: 1.4.2, author: The WordPress.org community
    Kento Top Authors: version: 1.0, author: KentoThemes
    Multi-Author AdSense: version: 1.0, author: The Plugin Factory
    P3 (Plugin Performance Profiler): version: 1.5.3.9, author: GoDaddy.com
    Poll, Survey, Form & Quiz Maker by OpinionStage: version: 19.6.31, author: OpinionStage.com
    Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated): version: 19.6.31, author: OpinionStage.com
    Post Profit Stats: version: 1.1.2, author: SlickRemix
    Recent comments widget with excerpts: version: 0.111017, author: Corey Salzano
    Simple Login Log: version: 1.1.3, author: Max Chirkov
    Social Metrics Tracker: version: 1.6.8, author: Ben Cole
    Super Link Preview: version: 1.0.1, author: Daniele Perilli
    Top Authors: version: 1.0.11, author: Daniel Pataki
    User Spam Remover: version: 1.0, author: Joel Hardi
    Visual Editor Custom Buttons: version: 1.5.2.3, author: Ola Eborn
    WP-Infobox: version: 0.8, author: Jonas Nordstrom
    WP Data Access: version: 2.6.1, author: Peter Schulz
    WP Super Cache: version: 1.7.0, author: Automattic
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_Imagick
    imagick_module_version: 1690
    imagemagick_version: ImageMagick 6.9.10-50 Q16 amd64 2019-07-25 https://imagemagick.org
    imagick_limits: 
    	imagick::RESOURCETYPE_AREA: 128 GB
    	imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
    	imagick::RESOURCETYPE_FILE: 1412559
    	imagick::RESOURCETYPE_MAP: 128 GB
    	imagick::RESOURCETYPE_MEMORY: 64 GB
    	imagick::RESOURCETYPE_THREAD: 1
    gd_version: 2.2.5
    ghostscript_version: 9.27
    
    ### wp-server ###
    
    server_architecture: FreeBSD 12.0-RELEASE-p9 amd64
    httpd_software: nginx/1.16.1
    php_version: 7.3.8 64bit
    php_sapi: fpm-fcgi
    max_input_variables: 5000
    time_limit: 180
    memory_limit: 512M
    max_input_time: -1
    upload_max_size: 1024M
    php_post_max_size: 1024M
    curl_version: 7.65.1 OpenSSL/1.1.1a
    suhosin: false
    imagick_availability: true
    htaccess_extra_rules: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 5.7.27-log
    client_version: mysqlnd 5.0.12-dev - 20150407 
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_MAX_MEMORY_LIMIT: 512M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable
    
    ### jetpack ###
    
    site_id: 52994152
    ssl_cert: No
    time_diff: undefined
    version_option: 7.8:1570004051
    old_version: 7.7.2:1569264528
    public: Public
    version: 7.8
    SERVER_PORT: 80
    HTTPS: off
    protect_header: {"trusted_header":"REMOTE_ADDR","segments":1,"reverse":false}
    full_sync: {"started":"Mon, 17 Sep 2018 10:51:32 +0000","queue_finished":"Mon, 17 Sep 2018 10:51:32 +0000","send_started":"Mon, 17 Sep 2018 10:51:37 +0000","finished":"Mon, 17 Sep 2018 10:51:37 +0000","sent":{"constants":1,"functions":1,"options":1,"users":1},"sent_total":[],"queue":{"constants":1,"functions":1,"options":1,"users":1},"config":{"options":true,"functions":true,"constants":true,"users":[7990]},"total":{"constants":1,"functions":1,"options":1,"users":1}}
    sync_size: undefined
    sync_lag: 0 seconds
    full_sync_size: undefined
    full_sync_lag: 0 seconds
    idc_error_option: false
    idc_optin: true
    cxn_tests: All Pass.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator bcworkz

    (@bcworkz)

    The error message is because WP could not insert a new DB record into the terms table for the term being split. This is essential because each of the term’s taxonomies needs to have a its own unique term ID. This is accomplished by inserting additional term records, one for each taxonomy. Being unable to add records makes splitting impossible.

    The plugin uses the same function that WP update uses to split terms. It’s failing for the same reason the terms were not split to start with. Until WP can insert records using this function, splitting terms would be difficult.

    Can you manually insert new terms? If so, its strange the above process doesn’t work.

    I suppose you could manually split terms through phpMyAdmin, replicating a term’s data in a new record. Update one of the taxonomies using the old term ID in the taxonomy table to the new term ID. This splitting gets more complicated if the split term has child terms, as those term’s parent ID needs updating as well.

    It would be horribly tedious to manually split 47 terms, but if things appear to be desperate, it’s a possibility. Be sure to back up the taxonomy and terms tables before attempting anything like this. Test one split thoroughly before spending time on further splits.

    For reference, the PHP code to do the splitting is at https://core.trac.wordpress.org/browser/tags/5.2/src/wp-includes/taxonomy.php#L3759

    Thread Starter Motljus

    (@motljus)

    Well we have been able to add new terms (both new categories and tags) and also delete those who are not conflicting, without any problems.
    It is just those 47 that are sharing the same ID that are causing problems, so that can’t be the reason and we aren’t getting any more error logging from the script than that it is unable to split the terms.

    Thread Starter Motljus

    (@motljus)

    Thanks for the link to where in the source code btw, @bcworkz
    It made me search for the WP_error I was logging

    Could not split shared term.

    Which in turn led me to this part of the code;

    	if ( false === $wpdb->insert( $wpdb->terms, $new_term_data ) ) {
    		return new WP_Error( 'db_insert_error', __( 'Could not split shared term.' ), $wpdb->last_error );
    	}

    …so I logged the array $new_term_data

    Array ( [name] => Rollspel [slug] => rollspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 3 could not be split! -> Could not split shared term.1
    Array ( [name] => Rollspel [slug] => rollspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 101 could not be split! -> Could not split shared term.1
    Array ( [name] => Dataspel [slug] => dataspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 37 could not be split! -> Could not split shared term.1
    Array ( [name] => Dataspel [slug] => dataspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 211 could not be split! -> Could not split shared term.1
    Array ( [name] => Bordsrollspel [slug] => bordsrollspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 47 could not be split! -> Could not split shared term.1
    Array ( [name] => Bordsrollspel [slug] => bordsrollspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 554 could not be split! -> Could not split shared term.1
    Array ( [name] => Skräck [slug] => skrack [term_group] => 0 )
    ERROR: Term Taxonomy ID 556 could not be split! -> Could not split shared term.1
    Array ( [name] => Skräck [slug] => skrack [term_group] => 0 )
    ERROR: Term Taxonomy ID 58 could not be split! -> Could not split shared term.1
    Array ( [name] => Figurspel [slug] => figurspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 61 could not be split! -> Could not split shared term.1
    Array ( [name] => Figurspel [slug] => figurspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 1870 could not be split! -> Could not split shared term.1
    Array ( [name] => Fantasy [slug] => fantasy [term_group] => 0 )
    ERROR: Term Taxonomy ID 547 could not be split! -> Could not split shared term.1
    Array ( [name] => Fantasy [slug] => fantasy [term_group] => 0 )
    ERROR: Term Taxonomy ID 71 could not be split! -> Could not split shared term.1
    Array ( [name] => Warhammer 40k [slug] => warhammer-40k [term_group] => 0 )
    ERROR: Term Taxonomy ID 1868 could not be split! -> Could not split shared term.1
    Array ( [name] => Warhammer 40k [slug] => warhammer-40k [term_group] => 0 )
    ERROR: Term Taxonomy ID 82 could not be split! -> Could not split shared term.1
    Array ( [name] => Science Fiction [slug] => science-fiction [term_group] => 0 )
    ERROR: Term Taxonomy ID 549 could not be split! -> Could not split shared term.1
    Array ( [name] => Science Fiction [slug] => science-fiction [term_group] => 0 )
    ERROR: Term Taxonomy ID 91 could not be split! -> Could not split shared term.1
    Array ( [name] => Cthulhu [slug] => cthulhu [term_group] => 0 )
    ERROR: Term Taxonomy ID 555 could not be split! -> Could not split shared term.1
    Array ( [name] => Cthulhu [slug] => cthulhu [term_group] => 0 )
    ERROR: Term Taxonomy ID 102 could not be split! -> Could not split shared term.1
    Array ( [name] => Lajv [slug] => lajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 540 could not be split! -> Could not split shared term.1
    Array ( [name] => Lajv [slug] => lajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 136 could not be split! -> Could not split shared term.1
    Array ( [name] => Krönika [slug] => kronika [term_group] => 0 )
    ERROR: Term Taxonomy ID 175 could not be split! -> Could not split shared term.1
    Array ( [name] => Krönika [slug] => kronika [term_group] => 0 )
    ERROR: Term Taxonomy ID 171 could not be split! -> Could not split shared term.1
    Array ( [name] => brevlajv [slug] => brevlajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 841 could not be split! -> Could not split shared term.1
    Array ( [name] => brevlajv [slug] => brevlajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 199 could not be split! -> Could not split shared term.1
    Array ( [name] => Fantasylajv [slug] => fantasylajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 583 could not be split! -> Could not split shared term.1
    Array ( [name] => Fantasylajv [slug] => fantasylajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 232 could not be split! -> Could not split shared term.1
    Array ( [name] => LAN [slug] => lan [term_group] => 0 )
    ERROR: Term Taxonomy ID 564 could not be split! -> Could not split shared term.1
    Array ( [name] => LAN [slug] => lan [term_group] => 0 )
    ERROR: Term Taxonomy ID 1880 could not be split! -> Could not split shared term.1
    Array ( [name] => LAN [slug] => lan [term_group] => 0 )
    ERROR: Term Taxonomy ID 287 could not be split! -> Could not split shared term.1
    Array ( [name] => Datorspel [slug] => datorspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 1881 could not be split! -> Could not split shared term.1
    Array ( [name] => Datorspel [slug] => datorspel [term_group] => 0 )
    ERROR: Term Taxonomy ID 289 could not be split! -> Could not split shared term.1
    Array ( [name] => Zombie [slug] => zombie [term_group] => 0 )
    ERROR: Term Taxonomy ID 551 could not be split! -> Could not split shared term.1
    Array ( [name] => Zombie [slug] => zombie [term_group] => 0 )
    ERROR: Term Taxonomy ID 379 could not be split! -> Could not split shared term.1
    Array ( [name] => Historiskt [slug] => historiskt [term_group] => 0 )
    ERROR: Term Taxonomy ID 558 could not be split! -> Could not split shared term.1
    Array ( [name] => Historiskt [slug] => historiskt [term_group] => 0 )
    ERROR: Term Taxonomy ID 497 could not be split! -> Could not split shared term.1
    Array ( [name] => Airsoft [slug] => airsoft [term_group] => 0 )
    ERROR: Term Taxonomy ID 541 could not be split! -> Could not split shared term.1
    Array ( [name] => Airsoft [slug] => airsoft [term_group] => 0 )
    ERROR: Term Taxonomy ID 590 could not be split! -> Could not split shared term.1
    Array ( [name] => Turnering [slug] => turnering [term_group] => 0 )
    ERROR: Term Taxonomy ID 546 could not be split! -> Could not split shared term.1
    Array ( [name] => Turnering [slug] => turnering [term_group] => 0 )
    ERROR: Term Taxonomy ID 1558 could not be split! -> Could not split shared term.1
    Array ( [name] => Elmia [slug] => elmia [term_group] => 0 )
    ERROR: Term Taxonomy ID 565 could not be split! -> Could not split shared term.1
    Array ( [name] => Elmia [slug] => elmia [term_group] => 0 )
    ERROR: Term Taxonomy ID 1789 could not be split! -> Could not split shared term.1
    Array ( [name] => barnlajv [slug] => barnlajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 569 could not be split! -> Could not split shared term.1
    Array ( [name] => barnlajv [slug] => barnlajv [term_group] => 0 )
    ERROR: Term Taxonomy ID 899 could not be split! -> Could not split shared term.1
    Array ( [name] => Martinsgården [slug] => martinsgarden [term_group] => 0 )
    ERROR: Term Taxonomy ID 824 could not be split! -> Could not split shared term.1
    Array ( [name] => Martinsgården [slug] => martinsgarden [term_group] => 0 )
    ERROR: Term Taxonomy ID 828 could not be split! -> Could not split shared term.1
    Array ( [name] => Berghem [slug] => berghem [term_group] => 0 )
    ERROR: Term Taxonomy ID 883 could not be split! -> Could not split shared term.1
    Array ( [name] => Berghem [slug] => berghem [term_group] => 0 )
    ERROR: Term Taxonomy ID 903 could not be split! -> Could not split shared term.1

    Is term_group meant to be 0? Otherwise I can’t tell what is causing the insert to fail. Can you?

    Thread Starter Motljus

    (@motljus)

    Please.
    Does anyone have experience with not being able to split their terms at all, or does anyone know where to keep looking or debug to track down the reason of this bug?

    Moderator bcworkz

    (@bcworkz)

    Hi Motljus, I’m sorry I missed you previous post. On occasion notifications fail to come through to my email. I’m even more sorry to hear you’re still struggling with this.

    It is common for “term_group” to be 0, I’m not sure if the field is even used, every single one of my terms have 0 value. From your logged data, it appears the terms are already split as each term has two different IDs. Unless the terms had more than 2 taxonomies? Get into phpMyAdmin and search the term_taxonomy table for term_id 3 and 101 (Rollspel). If each term_id has a single, unique taxonomy, then the terms are already split!

    I suspect the splitting is incomplete though, which would be evidenced by one ID having two different taxonomies and the other none. You ought to be able to change one of the taxonomy row’s term_id to that of the term with no current entries in order to complete the split. Of course, you should backup the table before making such changes and test one change thoroughly before making further changes.

    If that doesn’t check out, there are some table maintenance operations you can try in phpMyAdmin. Maybe after running these the splitting will succeed. For each table go to More > Operations. Near the bottom under Table Maintenance are Defragment and Optimize operations you can do. Again, you should make backups before making changes to the DB.

    Thread Starter Motljus

    (@motljus)

    Thanks for answering.
    Had to check with the database to get the full info first;
    That is unfortunately the Term Taxonomy ID that is different. They still share the same Term ID = 3 (Rollspel)

    SELECT * FROM 'wp_spelkult_se_terms'ORDER BY'term_id' ASC
    
    term_id name	slug	term_group
    3 	Rollspel 	rollspel 	0
    43 	Levande rollspel 	levande-rollspel 	0
    44 	Bordsrollspel 	bordsrollspel 	0
    SELECT * FROM'wp_spelkult_se_term_taxonomy'WHERE'term_id' = 3
    
    term_taxonomy_id	term_id	taxonomy	description	parent	count
    3 	3 	category 	Artiklar om allt från bordsrollspel till levande r... 	0 	48
    101 	3 	post_tag 		0 	0
    • This reply was modified 4 years, 5 months ago by Motljus.
    • This reply was modified 4 years, 5 months ago by Motljus.
    Thread Starter Motljus

    (@motljus)

    Tried running repair and got this cutoff message;

    spelkult_se.wp_spelkult_se_termmeta 	repair 	note 	The storage engine for the table doesn't support r...
    spelkult_se.wp_spelkult_se_terms 	repair 	note 	The storage engine for the table doesn't support r...
    spelkult_se.wp_spelkult_se_term_relationships 	repair 	note 	The storage engine for the table doesn't support r...
    spelkult_se.wp_spelkult_se_term_taxonomy 	repair 	note 	The storage engine for the table doesn't support r...

    Optimize resulted in these messages

    spelkult_se.wp_spelkult_se_termmeta 	optimize 	note 	Table does not support optimize, doing recreate + ...
    spelkult_se.wp_spelkult_se_termmeta 	optimize 	status 	OK
    spelkult_se.wp_spelkult_se_terms 	optimize 	note 	Table does not support optimize, doing recreate + ...
    spelkult_se.wp_spelkult_se_terms 	optimize 	status 	OK
    spelkult_se.wp_spelkult_se_term_relationships 	optimize 	note 	Table does not support optimize, doing recreate + ...
    spelkult_se.wp_spelkult_se_term_relationships 	optimize 	status 	OK
    spelkult_se.wp_spelkult_se_term_taxonomy 	optimize 	note 	Table does not support optimize, doing recreate + ...
    spelkult_se.wp_spelkult_se_term_taxonomy 	optimize 	status 	OK
    Thread Starter Motljus

    (@motljus)

    Check and analyze results in Status OK however, if that says anything.

    Moderator bcworkz

    (@bcworkz)

    The table operations probably wouldn’t have helped anyway, it was just something to try out of few better ideas. Because we can be sure the post_tag taxonomy terms have no children (taxonomy is not hierarchical), you can change the term_id value 3 to 101 for the post_tag entry (taxonomy_term_id 101). Then go to the respective taxonomy list tables in WP admin and confirm the action links (“edit”, “view”, but not “delete”) for each Rollspell term work as expected.

    The term_id and taxonomy_term_id matching is very common, but not a requirement. Also check the termmeta table for any entries for term_id 3. If there is data, but nothing for 101, decide if it is logical for any such meta data to be duplicated for the post_tag term as well. WP doesn’t add any term meta but themes and plugins might.

    If that all checks out then the Rollspel term has finally been properly split (!) and it shouldn’t show up in the WP split terms errors. You can then proceed in a similar manner for the other terms that are throwing split errors. Doing so manually for all the terms would be extremely tedious. IF one of the problem terms is always a post_tag term, it may be possible to write an SQL query that fixes up all the term_taxonomy entries in one go. I’m not sure though, SQL is not my strong suit.

    The entire process could be custom coded in PHP for sure, but chances of doing it wrong and corrupting the table is very real. It would entail some very careful, limited testing before turning such a script loose on your DB.

    Thread Starter Motljus

    (@motljus)

    I have begun clearing up tags from a the first of the conflicting taxonomy terms, in an attempt to make them easier to split or perhaps even delete the unused completely. That is why there are no tags using the term “dataspel” no more, but 48 using the category with the same term id and name.

    The problem with replacing the term_id (3) for taxonomy_term_id 101 with 101, if I understand you correctly, is that the term_id 101 is already populated with another term;
    101 Crowdfunding crowdfunding 0

    Is that perhaps the reason why the split is malfunctioning?

    Moderator bcworkz

    (@bcworkz)

    Ah geez, I sure messed up my advice of term 101. I somehow read “term_id” in the splitting error output when clearly it is taxonomy_term_id. So sorry.

    Anyway, see if there is another Rollspel term in the terms table besides ID 3, if so that term_id is the one to place as term_id for the term_taxonomy_id 101 entry in term_taxonomy table. I don’t think that term 101 already being assigned is the problem, there is no reason term and taxonomy terms need to match. There does now need to be a separate term for each taxonomy now, the entire reason for splitting.

    If there is no second Rollspel term in the terms table, insert a new row for one using phpMyAdmin. Then set that new term_id for the term_id field in the term_taxonomy_id 101 row. Then test the Rollspel tag in WP admin to confirm the change is acceptable to WP.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Unable to split shared taxonomy terms’ is closed to new replies.