Free tools Windows power users keep installed
One-click scans. No signup required.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
A WordPress transient is a named cache value that can have an expiration time. WordPress stores it through set_transient(), reads it with get_transient(), and removes it with delete_transient(). The WP-CLI command wp transient delete helps when you can identify the stale transient, but it does not purge page, CDN, browser, or every plugin cache. Use a specific key for a targeted refresh, --expired for cleanup, --all only for a deliberate broad reset, and --network when you are addressing multisite network transients.
What is the WordPress Transients API, and why does it matter?
The Transients API temporarily stores information across page loads so WordPress can reuse an expensive result instead of calculating or fetching it on every request. A transient has a name, a value, and optionally an expiration expressed in seconds. It is a cache, not permanent application data: your code must be able to recreate the value whenever it is missing.
The API provides three lifecycle functions:
| Function | Purpose | Important behavior |
|---|---|---|
set_transient( $transient, $value, $expiration ) |
Stores or replaces a named value. | Arrays and objects are serialized by WordPress. The database-backed name limit is 172 characters because WordPress adds prefixes. |
get_transient( $transient ) |
Reads the cached value. | Returns false when the key is absent or expired. In the database path, an expired value can be deleted while it is being read. |
delete_transient( $transient ) |
Removes one named value. | Returns a Boolean result and uses either the external object-cache delete path or the relevant database options. |
An expiration is a maximum lifetime, not a promise that the value will remain available until that time. The WordPress handbook specifically notes that external object caches and database upgrades can make a transient disappear earlier, but a value will not be returned after its expiration. Code should therefore treat every read as a cache lookup and regenerate on a miss.
Recommended Free Tools
How does a transient get written, read, and regenerated?
Application code normally follows a read-through pattern: try the transient, test for an actual miss, compute the result if necessary, then save it for later requests.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
$value = get_transient( 'product_feed' );
if ( false === $value ) {
$value = fetch_product_feed();
set_transient( 'product_feed', $value, 15 * MINUTE_IN_SECONDS );
}
return $value;
The strict comparison is essential. A valid cached result might be 0, an empty string, an empty array, or another falsey value. A loose test such as if ( ! $value ) would confuse one of those legitimate results with a cache miss and needlessly regenerate it. A plain Boolean false is especially problematic as a payload because it is indistinguishable from the API’s miss signal; use a different representation when your application needs to cache a negative result.
The third argument to set_transient() is measured in seconds. Passing zero means no expiration in the function reference, although non-expiring values have different autoload implications in the options-based implementation. An expiration should reflect how long the underlying data can safely be reused, not how long you hope the request will be fast.
When the value is an array or object, the API serializes it for storage and restores it on retrieval. Keep the transient name stable and within the documented limit, and include enough context in the name to prevent collisions—for example, a locale or a query variant—without making the key longer than necessary.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesWhere are WordPress transients stored?
Storage depends on the active object-cache implementation. Without a persistent object-cache drop-in, WordPress stores transient data in database options; with one, the transient layer can use Redis, Memcached, or another object cache instead.
Database-backed storage
On a single-site installation, the default path uses the wp_options table. WordPress stores the value and its timeout as options, which is why an expired transient can be removed during a read. On multisite, network transients use the network metadata storage represented by wp_sitemeta, while each site’s local transients remain associated with that site’s options.
Persistent object-cache storage
A persistent object-cache drop-in changes where the value lives and how long it survives infrastructure events. The transient functions still provide the same API, but the cache backend may evict an entry before its requested expiration. A successful deletion therefore means that the selected transient was removed from the active transient store; it does not prove that a database row, page cache, or other copy existed or was purged.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Storage architecture matters when troubleshooting. Two otherwise identical WordPress sites can behave differently if one uses only database options and the other uses a Redis or Memcached drop-in. Check which object-cache implementation is active before assuming that inspecting the database will reveal the value.
When should I run wp transient delete KEY?
Run the targeted command when you know the transient name representing data that has become stale. Deleting that key invalidates only that cached result; the next request that calls get_transient() receives a miss and the application can rebuild it.
wp transient delete sample_key
Typical triggers include changing content that feeds a generated block, updating a setting used in a computed result, changing a taxonomy term, correcting a remote API response, or deploying code that changes the format of a generated value. The safest workflow is to map the visible stale output to the code that creates it, identify the exact key, and delete only that key.
| Situation | Preferred action | Reason |
|---|---|---|
| One known result is stale after a content or settings change | wp transient delete KEY |
Invalidates only the affected value so it can regenerate. |
| You need housekeeping for entries that have already expired | wp transient delete --expired |
Removes expired entries without intentionally discarding still-valid values. |
| An incident requires every transient in one scope to be rebuilt | wp transient delete --all |
Performs broad invalidation; use only when the regeneration impact is acceptable. |
| A network transient is wrong on multisite | Add --network |
Selects the network-transient namespace rather than a single site’s local namespace. |
| The page remains stale after deleting the key | Inspect other cache layers | The command is limited to the transient layer and selected scope. |
What does --expired do?
wp transient delete --expired removes transients whose expiration has passed. It is a maintenance operation, not a request to rebuild every currently valid cache value.
wp transient delete --expired
Choose this option when the goal is cleanup of expired entries or reduction of stale records in a database-backed installation. It does not target values that are still within their requested lifetime, and it does not force valid results to be fetched again. Because an external object cache may evict entries on its own, the set of expired database entries may not represent every transient that has ever existed.
What does --all do, and when is it safe?
wp transient delete --all removes every transient in the selected local scope. It is appropriate for a deliberate cache reset or an incident in which the affected keys cannot be isolated, but it is too broad for routine stale-content fixes.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
wp transient delete --all
After a broad deletion, many requests can become misses at once. Code may then issue expensive database queries, remote API requests, or rendering work simultaneously. The command documentation defines the deletion scope; the possibility of a regeneration burst follows from every value being invalidated. Schedule a broad reset when traffic and upstream rate limits can tolerate that work, and prefer a targeted key whenever you can identify one.
--all is also scoped: without the network flag it addresses local transients for the current site context. It is not a universal instruction to clear every cache in a hosting stack.
What does --network change on multisite?
The --network flag selects network or site-wide transients in a multisite installation. Use it when the key was created with the network-transient API or otherwise belongs to the network namespace.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →wp transient delete network_key --network
Local transients belong to individual sites, so deleting a network transient does not remove each site’s local values. If an incident requires clearing local transients for every site, the WP-CLI documentation’s approach is to iterate through the sites and run the local deletion in each site context, while handling network transients separately with --network. Confirm the namespace before deleting; using the flag against a local key can leave the stale site-specific value untouched.
Will deleting a transient clear every cache?
No. The command invalidates a transient in the WordPress transient layer and scope you selected. It does not automatically purge a full-page cache, reverse proxy, CDN, browser cache, or a plugin’s separate application cache.
A browser can continue displaying an old response even after the origin has regenerated its transient. Likewise, a CDN or reverse proxy can serve an already-rendered page whose HTML contains the old value, while the next uncached origin request would be correct. Those layers require their own documented purge or cache-bypass mechanism.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Use a layered diagnosis:
- Verify that the visible data is actually produced by a transient and identify its exact key.
- Delete the key with
wp transient delete KEY, then make a request that reaches WordPress rather than a cached edge response. - Check whether the origin response is now correct. If it is correct at the origin but stale to visitors, investigate page-cache, reverse-proxy, CDN, and browser layers.
- If the origin remains wrong, inspect the regeneration code, the selected site or network scope, and the active object-cache implementation.
How should application code handle early expiration and cache misses?
Design every transient consumer to recover when the value vanishes before its nominal timeout. A miss should run the same safe regeneration path used after an ordinary expiration, then write the new value with an appropriate lifetime.
- Use
false === get_transient( $key )rather than a loose falsey test. - Keep regeneration deterministic and idempotent so two requests rebuilding the same key do not corrupt shared state.
- Expect an external cache or database maintenance event to remove the value early.
- Do not treat a transient as the authoritative record; store durable business data elsewhere.
- Choose an expiration that limits staleness while avoiding unnecessary remote calls.
Because a transient can disappear at any point before its maximum lifetime, code that only works when the timeout is reached is fragile. The correct contract is “use this value if available; otherwise calculate it again.”
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What are the most common deletion mistakes?
Deleting every key to fix one stale result
Using --all for a single bad widget or feed discards unrelated valid work. Find the key and perform a targeted deletion unless the incident genuinely affects the whole transient namespace.
Assuming a successful command purged the page
A transient deletion can succeed while an HTML page remains cached elsewhere. Test an origin response and follow the separate purge procedure for each additional cache layer.
Using the wrong multisite scope
A network transient and a site-local transient are different namespaces. Add --network only for the network value, and iterate through sites when local values must be handled across a network.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Expecting the timeout to guarantee availability
The expiration is an upper bound. External object-cache eviction and database changes can remove the value sooner, so a miss path is mandatory even when the requested lifetime is long.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Storing an ambiguous Boolean
If the application needs to cache “no result,” do not use a bare false payload that is indistinguishable from a miss. Store a structure or another explicit representation and continue to test the API result strictly.
Which action should I choose during an incident?
Start with the narrowest invalidation that can correct the observed problem.
- Known key: run
wp transient delete KEY. - Routine expired-entry cleanup: run
wp transient delete --expired. - Unknown or widespread corruption: consider
wp transient delete --allafter assessing regeneration and upstream-load risks. - Multisite network value: add
--networkand verify that the key is network-scoped. - Still stale: investigate page, proxy, CDN, browser, and plugin-specific caches rather than repeating transient deletion.
This sequence preserves valid cached work whenever possible while still providing an escape hatch for broad incidents. It also keeps the diagnosis tied to the cache layer that the command actually controls.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
How long do WordPress transients last if no expiration is set?
Passing zero as the expiration means the function reference treats the transient as non-expiring. That does not make it permanent storage: an object-cache eviction, database operation, or manual deletion can still remove it, and non-expiring options have different autoload implications.
Can I delete a transient directly from the database?
Database-backed transients are represented by option records and timeout records, but direct edits bypass the API and can leave related data inconsistent. Prefer the API or WP-CLI so the active object-cache implementation and the correct scope are handled together.
Why does my transient return false immediately after I set it?
The key may be longer than the database-backed limit, the read may be using a different site or network scope, or an external object cache may have evicted it. Confirm that the exact same key and context are used for both calls and that the regeneration code does not overwrite the value.
Do transients work the same way on every hosting setup?
The API contract is consistent, but storage and eviction behavior depend on whether the site uses database options or a persistent object-cache drop-in such as Redis or Memcached. That infrastructure difference can change what you see when inspecting storage and how early a value disappears.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

