WordPress: Storing Temporary Information

When developing plugins for WordPress, most of the time I deal with semi-permanent settings with my plugins. A user goes to the “Settings” page for the plugin, they set things up the way they want them, and they expect those settings to remain that way until they decide to change them again.

However, there are times when you need to store temporary information that needs to either expire or be updated on a regular basis. There are functions within WordPress to help you with that, too. They are part of the “transient API” in WordPress. Basically, transient options are options that have an expiration date.