Title: Logout Clear Cookies
Author: Joel
Published: <strong>7 March 2017</strong>
Last modified: 8 November 2023

---

Search plugins

This plugin **hasn’t been tested with the latest three major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/logout-clear-cookies/assets/icon.svg?rev=1630378)

# Logout Clear Cookies

 By [Joel](https://profiles.wordpress.org/joelhardi/)

[Download](https://downloads.wordpress.org/plugin/logout-clear-cookies.zip)

 * [Details](https://en-gb.wordpress.org/plugins/logout-clear-cookies/#description)
 * [Reviews](https://en-gb.wordpress.org/plugins/logout-clear-cookies/#reviews)
 *  [Installation](https://en-gb.wordpress.org/plugins/logout-clear-cookies/#installation)
 * [Development](https://en-gb.wordpress.org/plugins/logout-clear-cookies/#developers)

 [Support](https://wordpress.org/support/plugin/logout-clear-cookies/)

## Description

This is an extremely simple plugin (one line of code!) that deletes all domain cookies
whenever a user logs out of your WordPress site, and then redirects the user to 
the site homepage.

**Why?** Because by default, WordPress sets a number of cookies that it doesn’t 
remove on its own when you log out.

There are security and privacy benefits, because if there are vulnerabilities in
WordPress or in your browser, or if someone has access to your computer or device,
they may be able to access these cookies. (That goes for you or for anyone who logs
into your site to add a post or comment.)

Likewise, when a user logs out of your site using a public or shared computer, there
won’t be any domain cookies left behind.

The plugin also gives you back the “regular user view” of your site, because after
you log out you can browse your site as an anonymous user, without having to manually
clear cookies in your browser. (There are many plugins that will display different
content or show cached or uncached versions of pages if they see that WordPress 
cookies have been set.)

## Installation

 1. Install and activate. That’s it!

The plugin does not modify your files or database in any way, and does not actually
contain any activation or deactivation code.

**To uninstall,** simply delete the plugin. You can deactivate it first, but it 
is also perfectly safe to delete the plugin without deactivating.

## FAQ

### The plugin didn’t clear all the cookies in my browser, why not? I want a plugin that can delete *all* cookies, not just those set for my site’s domain name.

This plugin clears cookies set on your site’s domain or subdomain (whatever WordPress
has set the value of `COOKIE_DOMAIN` to be).

It is not possible for a web application to set or clear any cookies except for 
those that it has previously set on its own domain. This is a standard part of every
browser’s security model! It would be a huge security flaw if your browser allowed
a website to view, set or clear the cookies used by another website.

### Why redirect to the site homepage after logout instead of back to the admin console login page (`wp-login.php`)?

Because the admin console login page actually sets a new cookie when your browser
loads it.

## Reviews

![](https://secure.gravatar.com/avatar/d10be804f7041d8057112270de59b571f596c61a1621150958d527bebbfdbd4e?
s=60&d=retro&r=g)

### 󠀁[Perfect!](https://wordpress.org/support/topic/perfect-8986/)󠁿

 [sveronik](https://profiles.wordpress.org/sveronik/) 29 December 2021

Thank you so much ! I was looking for a solution for a long long time and you really
saved me. My website changes were not reflected for customers and now the issue 
resolved.

![](https://secure.gravatar.com/avatar/cc5128382c498ec51736f6b213f8d51b24684b151a5b16514e52ee25d4006441?
s=60&d=retro&r=g)

### 󠀁[Thanks!](https://wordpress.org/support/topic/thanks-1906/)󠁿

 [metalhead505](https://profiles.wordpress.org/metalhead505/) 27 August 2020

I tried deleting cookies with my own code but I failed miserably. Thanks for this
plugin and thanks for making it light.

![](https://secure.gravatar.com/avatar/f50f368fb16cb3855b7c285e978dc550673e14cc930948e0bbea44994d3df1a4?
s=60&d=retro&r=g)

### 󠀁[This plugin saved me!](https://wordpress.org/support/topic/this-plugin-saved-me-12/)󠁿

 [CC05](https://profiles.wordpress.org/ayano-hisa-photo/) 31 May 2020

I've been looking for a solution for problems I had with Favorites plugin for 2 
days now. When I logout, the favorite buttons should be unpressed and I shouldn't
be able to see favorite lists, but I was still seeing them and buttons still remained
pressed. I cleared cache, disabled all plugins and reactivated one by one, changed
theme, tried different browser, different computer, etc, etc, but could solve it.
Then I found out if I manually remove cookies after logout, it solves the problem.
But I cannot ask users to remove cookies after logging out. So I was wishing there
would be a plugin to clear cookies after users logout. And there it is! This plugin
solved all issues at once. Thanks so much!!

![](https://secure.gravatar.com/avatar/0d700fd128ba272eb9345347caf030297ba6814fc87a6317c704c8b2ad1c0696?
s=60&d=retro&r=g)

### 󠀁[Good](https://wordpress.org/support/topic/good-3541/)󠁿

 [khalka](https://profiles.wordpress.org/khalka/) 15 May 2018

It's, work!

 [ Read all 4 reviews ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/)

## Contributors and Developers

“Logout Clear Cookies” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Joel ](https://profiles.wordpress.org/joelhardi/)

[Translate “Logout Clear Cookies” into your language.](https://translate.wordpress.org/projects/wp-plugins/logout-clear-cookies)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/logout-clear-cookies/),
check out the [SVN repository](https://plugins.svn.wordpress.org/logout-clear-cookies/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/logout-clear-cookies/)
by [RSS](https://plugins.trac.wordpress.org/log/logout-clear-cookies/?limit=100&mode=stop_on_copy&format=rss).

## Change Log

#### 0.2

 * Changed redirect url from WP_HOME to get_option(‘siteurl’).

#### 0.1

 * Initial public release.
 * Tested over two years using WordPress 3.7 through 4.7.3.

## Meta

 *  Version **0.2**
 *  Last updated **3 years ago**
 *  Active installations **500+**
 *  WordPress version ** 3.7 or higher **
 *  Tested up to **6.4.14**
 *  Language
 * [English (US)](https://wordpress.org/plugins/logout-clear-cookies/)
 * Tags
 * [admin](https://en-gb.wordpress.org/plugins/tags/admin/)[cookie](https://en-gb.wordpress.org/plugins/tags/cookie/)
   [privacy](https://en-gb.wordpress.org/plugins/tags/privacy/)[security](https://en-gb.wordpress.org/plugins/tags/security/)
 *  [Advanced View](https://en-gb.wordpress.org/plugins/logout-clear-cookies/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  4 5-star reviews     ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/logout-clear-cookies/reviews/)

## Contributors

 *   [ Joel ](https://profiles.wordpress.org/joelhardi/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/logout-clear-cookies/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://lyncd.com/donate/)