• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

Fixing a slow WordPress installation with thousands of hierarchical taxonomy values

Wordpress · August 6, 2021

Recently while working on a large-scale WordPress site, I encountered a tricky situation. I had quite a lot of locality data for Australian states, suburbs and LGA’s (Local Government Areas). We are talking about tens of thousands of items in the database.

At first, I made all of these custom taxonomies hierarchical. Part of the reasoning was that users could visually select values from the meta boxes (hierarchical taxonomies look better). Initially, it wasn’t a problem, but as more data was added, saving posts took forever, I was getting timeouts, and queries were slow.

If you are reading in hopes of a solution that allows you to keep using hierarchical taxonomies with tens of thousands of items, I am sorry to disappoint you.

The solution was to make all of my large taxonomies non-hierarchial. Literally setting the argument for the taxonomy to false. "hierarchical" => false,

I leveraged the Advanced Custom Fields plugin to create the taxonomy hierarchy using post relationships for those uses where I need a hierarchy. It’s not an ideal situation, but it works.

Sadly, WordPress has had this issue for several years now, and because of the way taxonomies work, I don’t think it will be fixed any time soon.

TL;DR — hierarchical taxonomies will not work properly for thousands of items. Use non-hierarchical taxonomies instead.

Dwayne

Leave a Reply Cancel reply

0 Comments
Inline Feedbacks
View all comments

Primary Sidebar

Popular

  • Web 3.0 may have died before it even started
  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • NBN Box Installed Inside of Garage, Where Do You Put The Modem?
  • Smoke Detector Randomly Goes Off Early Hours of The Morning
  • A List of WordPress Gutenberg Core Blocks
  • Which Neural DSP Archetype Plugins Should You Buy?
  • How to Copy Files Using the Copy Webpack Plugin (without copying the entire folder structure)
  • How To Install Eufy Security Cameras Without Drilling or Using Screws
  • How To Calculate A Javascript Date X Months Ago With Vanilla Javascript

Recent Comments

  • Casey Milne on A List of WordPress Gutenberg Core Blocks
  • Jay on Neural DSP Reveal Details About the Long-Awaited Quad Cortex Desktop Editor
  • john on Deno Raises $21M – but is anyone using it yet?
  • Oranges on How To Store Users In Firestore Using Firebase Authentication
  • Precious on Fixing Sequel Pro SQL Encoding Error For Imported SQL Files

Copyright © 2022 · Dwayne Charrington · Log in

wpDiscuz