Sorry if vague, trying to track down recent website slowdown reasons, and query monitor shows me this as a DATABASE ERROR consistently for two particular transients being added:

enter image description here

Following the stacktrace seems to be a dead end, why is this throwing an error?

The line that triggers it is from my custom plugin setting a standard html-filled transient (10,000-20,000 chars), which has worked fine:

set_transient( $transient_name, $html, $transient_seconds );

By the way, running SHOW FULL COLUMNS FROM wp_options works fine in phpmyadmin

I also checked wp_options and saw the timeouts for these particular transients stored, but not the transient/values itself.

Any ideas?


  • 2
    that's a huge amount of data to store in a transient, if it's generating a DB error then it clearly is not working fine, assuming UTF-8 that's an 80kb file
    – Tom J Nowell
    Commented Apr 11, 2022 at 11:57
  • $transient (string) (Required) Transient name. Expected to not be SQL-escaped. Must be 172 characters or fewer in length. Could this come from the transient name?
    – froger.me
    Commented Apr 12, 2022 at 9:07
  • Weird: SHOW FULL COLUMNS table should not generate errors. WordPress uses it to capture a description of the table, not the contents of the table. The datatype of wp_options.option_value is LONGTEXT, so a 20k transient value is no problem at all: it can handle up to 4g. Is there some other query before this SHOW FULL COLUMNS query showing trouble? Please edit your question to tell us more.
    – O. Jones
    Commented Apr 14, 2022 at 11:31
  • @TomJNowell the news feeds on the dashboard home page have transients with several hundred K in them.
    – O. Jones
    Commented Apr 14, 2022 at 11:33
  • that doesn't mean you should store several hundred kb of data in transients, for example a lot of object caches have buckets of 1Mb so filling up your options table autoload with data past that value has major performance consequences. Likewise with people who put lots and lots of text in widgets can run into problems. Transients aren't for storing data that's large, they're for storing data that's expensive to generate/fetch, but they aren't the only mechanism around
    – Tom J Nowell
    Commented Apr 14, 2022 at 12:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.