Basically that's the question - I wonder if set_transient() overwrites/updates a transient option with the same key?


Yes, key (prefixed with string identifying it as transient) is used as option name when value is inserted in database.

  • Yes. As of 4.3.1, handled in wp-includes/option.php using delete_option() + add_option() or update_option(). If using an external object cache, uses wp_cache_set(), defined by memcached as "The value is set whether or not this key already exists in memcached."
    – here
    Sep 22 '15 at 19:05

Maybe, but in my case set_transient() has failed when re-used without delete_transient() first. For some time I thought the problem was that the array I was saving as a transient was too large but that wasn't it. I recommend that you delete the transient first if you're having a problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.