WordPress Test Cookie: What It Is & How to Fix Issues
In this article
A WordPress test cookie (usually named wordpress_test_cookie) is a small text file that WordPress sets in your browser to check whether cookies are enabled before it tries to log you in. It is not a tracking cookie, not a security vulnerability, and not something you need to delete. It is created by the core WordPress login system and is used only during the authentication process.
Why WordPress Sets a Test Cookie
When you visit the WordPress login page (wp-login.php), the code first sets a test cookie with the value WP Cookie check. The purpose is to verify that your browser accepts cookies. If cookies are disabled, WordPress cannot maintain your login session, so it shows an error like “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
The test cookie is set with the Set-Cookie header during the initial page load. If the browser returns that cookie on the next request, WordPress knows cookies work and proceeds with the login. If not, it blocks the login attempt. This is a standard mechanism used by many web applications, not something unique to WordPress.
How the Test Cookie Works
Here’s the exact flow:
- You visit
wp-login.php. - WordPress sends a
Set-Cookieheader forwordpress_test_cookiewith the valueWP Cookie check. - Your browser stores it (if cookies are enabled).
- When you submit the login form, WordPress checks whether that cookie was sent back.
- If yes, the login proceeds. If no, you get the cookie error message.
The cookie is not used for anything else. It is not sent to any third party, does not contain personal data, and is not part of the session management itself. Once you are logged in, WordPress sets separate authentication cookies (wordpress_logged_in_* and wordpress_sec_*) that handle the actual session.
Is the Test Cookie a Security Risk?
No. The test cookie is harmless. It contains only the literal string WP Cookie check and is not used for tracking, analytics, or advertising. It is a standard part of WordPress core and appears in every default installation. Security scanners sometimes flag it as a “cookie without HttpOnly flag” or similar, but that is a false positive—the cookie is not sensitive and is never used for authentication itself.
However, if you see the test cookie in your browser’s developer tools, you might also notice that it lacks the Secure and HttpOnly flags. That is by design: the test cookie does not need those flags because it contains no sensitive data. Adding them would not improve security and could cause issues with some setups.
Common Problems and Fixes
If you see the error “Cookies are blocked or not supported by your browser”, the test cookie is not being accepted. Here are the usual causes and solutions:
- Browser cookies disabled: Check your browser settings and enable cookies for your site’s domain.
- Cache plugin interference: Some caching plugins (like WP Super Cache or W3 Total Cache) may serve a cached version of the login page without the Set-Cookie header. Clear the cache or exclude
wp-login.phpfrom caching. - CDN or reverse proxy: If you use Cloudflare or a similar service, it might strip or alter the Set-Cookie header. Ensure that the login page is not cached at the CDN level.
- WordPress address mismatch: If the WordPress Address and Site Address in Settings > General are different (e.g., one uses
wwwand the other doesn’t), the cookie domain may not match. Keep both URLs identical. - Server time/date issues: If your server’s clock is wrong, the cookie expiry might be in the past, causing the browser to reject it. Check your server time.
If you are not seeing the error but the test cookie appears in your browser, that is normal—it is set on every login page visit.
How to Check If the Test Cookie Is Set
You can verify the test cookie in your browser’s developer tools:
- Open the login page (
wp-login.php). - Press F12 (or right-click > Inspect) to open Developer Tools.
- Go to the “Application” tab (Chrome) or “Storage” tab (Firefox).
- Under “Cookies,” select your site’s domain.
- Look for a cookie named
wordpress_test_cookiewith the valueWP Cookie check.
If it is there, cookies are working. If not, your browser or an intermediary is blocking it.
Frequently Asked Questions
Is the WordPress test cookie a tracking cookie?
No. It is used only to verify that cookies are enabled. It does not track you, does not contain any unique identifier, and is not used for analytics or advertising.
Should I delete the WordPress test cookie?
You can delete it, but it will be set again the next time you visit the login page. It is harmless, so there is no need to remove it manually.
Why does the test cookie appear on every page of my site?
It should not. The test cookie is only set on the login page. If you see it on other pages, there might be a caching or plugin issue. Check if a security plugin or caching plugin is setting it globally.
Can the test cookie cause login issues?
Yes, if it is not accepted by the browser, WordPress will block login. This is the intended behavior—it prevents login attempts when cookies are disabled.
Does the test cookie work with WordPress multisite?
Yes, the test cookie works the same way on WordPress Multisite. The cookie name may be prefixed with the site’s path, but the mechanism is identical.
Is the test cookie a sign of malware?
No. It is a standard WordPress core file. If you see it, it means you are using WordPress, not that your site is infected.
Alternatives and Related Cookies
WordPress uses several cookies, each with a specific purpose:
wordpress_test_cookie– checks if cookies are enabled.wordpress_logged_in_*– keeps you logged in on the front end.wordpress_sec_*– keeps you logged in on the admin side.wp-settings-*– stores your admin preferences (like editor view).
If you want to disable cookies entirely, you cannot use WordPress login—it requires cookies. However, you can use a plugin to set session cookies with different parameters, but the test cookie will still be set.