Setup & site building · Explainer
What Is a User Activation Key in WordPress? Explained

Short answer
A user activation key is a one-time secret WordPress saves in the users table to verify password reset and set-password links. Only a hashed copy with a timestamp is stored, and by default it expires after one day or once the new password is saved.
Key takeaways
- It lives in the user_activation_key column of the wp_users table.
- WordPress stores a timestamp and a hash, never the emailed key itself.
- Reset keys expire after one day by default and can be shortened with a filter.
- Each new reset request replaces the previous key, so only the latest link works.
- Clearing the field is safe and simply cancels pending reset links.
What is a user activation key in WordPress?
A user activation key is a one-time secret that WordPress stores in the user_activation_key column of the users table so it can verify password reset and set your password links.
Every WordPress user row has this column. Most of the time it is empty or holds an old value that no longer matters.
It becomes active when someone asks for a password reset or when an admin creates a new account and WordPress emails a link to set a password.
The name is a leftover from older versions, when the same field was used to activate new sign-ups. Today its main job is password resets.
Where is the user activation key stored?
It lives in the wp_users table, in a column called user_activation_key, next to fields like user_login, user_pass and user_email.
If your table prefix is not the default, the table name changes, for example abc_users. The column name stays the same.
You can see it in phpMyAdmin or Adminer by opening the users table and browsing a row. Our guide to changing a WordPress password in phpMyAdmin shows how to reach that table safely.
The WordPress developer handbook documents the full database description if you want to see every column.
How does WordPress use the activation key?
WordPress creates a random key when a reset is requested, saves a hashed copy with a timestamp in user_activation_key, and emails the plain key inside a link to the user.
When the user clicks the link, WordPress hashes the key from the URL and compares it with the stored value. If they match and the key has not expired, the reset form opens.
The function that builds the key is get_password_reset_key(). It fires when someone submits the Lost your password? form.
The check happens in check_password_reset_key(), which returns the user on success or an error such as invalid_key or expired_key.
Here is the flow in short:
- A user asks for a reset on the login screen.
- WordPress generates a random key.
- A hashed version plus a timestamp goes into the database.
- The email link carries the plain key and the username.
- WordPress compares the two when the link is opened.
- After the new password is saved, the stored key is cleared.
What does the stored value look like?
The stored value is a timestamp, a colon, and a hash, so it never contains the key that was sent by email.
A typical value starts with a Unix timestamp such as 1732190000, then a colon, then a long hashed string.
The timestamp lets WordPress work out whether the link is still within its allowed time. The hash lets it confirm the key without keeping the real key on file.
Because only the hash is stored, someone who reads your database cannot simply copy the value into a reset URL and use it.
This follows the advice in the OWASP Forgot Password Cheat Sheet, which recommends random, single-use, time-limited reset tokens that are stored hashed.
How long does a user activation key last?
By default a password reset key expires after one day, and developers can change that period with the password_reset_expiration filter.
The default comes from the DAY_IN_SECONDS constant. Sites with strict security rules sometimes shorten it to an hour.
Here is a simple example that you could place in a small custom plugin:
add_filter( 'password_reset_expiration', function () {
return HOUR_IN_SECONDS;
} );
Keep the window long enough for real users. Some email providers delay messages by several minutes.
Is the activation key used for new users too?
Yes, when an admin adds a user and sends the account notification, WordPress uses the same key system to build the set your password link in that email.
This is why new users do not get their password in plain text anymore. They get a link that expires.
On multisite networks, sign-ups that need email confirmation use a separate activation key stored in the signups table. That one is not the same as the user_activation_key column.
Some membership and user verification plugins create their own keys in user meta. Check your plugin's documentation if you use one.
How is the activation key different from other WordPress keys?
The user activation key is a short-lived, per-user token, while security salts, nonces and application passwords each serve different jobs.
People often mix these up, so this table sets them side by side.
| Item | Where it lives | What it does | How long it lasts |
|---|---|---|---|
| User activation key | wp_users table | Verifies password reset and set-password links | About one day by default |
| Security keys and salts | wp-config.php | Strengthen cookies and hashing | Until you change them |
| Nonces | Generated on the fly | Protect forms and actions from forged requests | Hours, not days |
| Application passwords | User meta | Let apps sign in through the REST API | Until revoked |
Our explainer on what a nonce is in WordPress covers the form protection side in more detail.
If you connect outside apps, see how to use application passwords in WordPress instead.
Why does WordPress say the password reset link is invalid?
An invalid or expired link usually means the key was already used, a newer reset request replaced it, or the one-day window has passed.
Each new reset request overwrites the old key. If a user clicks Lost your password? twice, only the latest email works.
Other common causes include:
- The email client or a security scanner opened the link first.
- A caching plugin or CDN served an old copy of the reset page.
- The link wrapped across two lines and got cut off.
- The site URL changed after the email was sent.
Ask the user to request one fresh link and open it right away. If that fails, our guide to WordPress reset password not working walks through the deeper fixes.
If the email never arrives at all, that is a mail delivery problem, not an activation key problem. See fixing password reset emails that never arrive.
Is it safe to clear the user activation key?
Yes, emptying the column is safe; it only cancels any pending reset link, and the user can request a new one at any time.
Some admins clear it after a security incident to make sure no old reset links still work. You can do that per user in phpMyAdmin by emptying the field.
Do not paste your own value into the column. WordPress expects a specific format, and a hand-typed value will not create a working link.
Always back up the database before editing tables directly. A wrong change in wp_users can lock people out.
Can attackers abuse the user activation key?
Attackers cannot read the real key from the database because only a hash is stored, but they can trigger reset emails, so rate limits and strong email security still matter.
Repeated reset requests can flood a user's inbox. A security plugin or a login limiter helps cut that noise.
The bigger risk is a compromised email account. Whoever controls the inbox can use the reset link.
WordPress keeps improving how it hashes passwords and keys in core updates. Running the latest WordPress version means you get those changes.
For a wider view of account safety, see how to recover a hacked WordPress admin account.
Do developers ever need to work with the activation key?
Developers rarely touch the column directly; they should call core functions like get_password_reset_key() and check_password_reset_key() so hashing and expiry stay correct.
Custom login pages and headless front ends often need their own reset flow. Calling core functions keeps them compatible with future WordPress changes.
Writing to user_activation_key with your own SQL skips the hashing step. That creates links that either fail or are less secure.
If you build your own token system outside WordPress, PHP's random_bytes() function is the standard way to produce secure random values.
The Plugin Handbook explains how to hook into user actions cleanly instead of editing tables.
Frequently asked questions
Where do I find the user activation key in WordPress?
Open your database tool, such as phpMyAdmin, and browse the users table. Each row has a user_activation_key column. It is often empty unless a password reset or new account email was sent recently.
Can I use the value in the database to reset a password?
No. The database holds a timestamp and a hash, not the key that was emailed. WordPress needs the original key from the email link, so copying the stored value into a URL will not work.
How long is a WordPress password reset link valid?
By default a reset key is valid for one day. Developers can shorten or extend this with the password_reset_expiration filter. Requesting a new link or setting a new password also makes older links stop working.
Why is my user_activation_key column empty?
An empty field is normal. It means no reset is pending, or the last reset was finished and WordPress cleared the key after the new password was saved.
Is the activation key the same as a security salt?
No. Salts live in the wp-config file and protect cookies and hashing for the whole site. The activation key is a short-lived token stored for one user to confirm a reset link.
Sources
- get_password_reset_key() WordPress Developer Resources
- check_password_reset_key() WordPress Developer Resources
- Plugin Handbook WordPress Developer Resources
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


