Title: Question about old data
Last modified: May 12, 2026

---

# Question about old data

 *  Resolved [tomdkat](https://wordpress.org/support/users/tomdkat/)
 * (@tomdkat)
 * [1 month ago](https://wordpress.org/support/topic/question-about-old-data/)
 * Hi! So, I used WP Statistics on a fairly busy site a couple of years ago and 
   switched to another statistics tool because WP Statistics wasn’t working for 
   me. I used that other tool up until about a couple of weeks ago, when IT started
   behaving differently and I went back to WP Statistics. 
   When I loaded WP Statistics
   again, I noticed in the Traffic Overview panel that shows today’s traffic, yesterday’s
   traffic and the total visits, etc, that it should over 200k total visits, which
   can’t be right since I had WP Statistics installed for only a day or so and the
   site will get hundreds of visits a day, nowhere near 100k a day. So, I looked
   at the settings and enabled the “delete all data when plugin is deleted” option,
   saved the change and deleted WP Statistics. I re-installed it and the total visits
   went to 0 BUT the “Yesterday” number wasn’t 0, which is weird since I had just
   deleted the plugin. lolSo, when WP Statistics is deleted and it’s setup to delete
   ALL data, something got missed. Is some traffic data is uses for reporting not
   stored in the database or something?Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [1 month ago](https://wordpress.org/support/topic/question-about-old-data/#post-18905392)
 * Hi [@tomdkat](https://wordpress.org/support/users/tomdkat/),
 * Thanks for the careful write-up. Short answer first, then the details and a couple
   of things to verify on your end.
 * All WP Statistics traffic data lives in the database, not in files. When the “
   Delete all data when plugin is deleted” option is enabled and you fully delete
   the plugin from the Plugins screen (the red Delete link, not just Deactivate),
   the uninstaller does all of the following:
 * – Deletes the `wp_statistics_*` rows from the options table.
    – Deletes every
   usermeta / postmeta key starting with `wp_statistics`. – Clears the scheduled
   cron hooks. – Drops every plugin table, including `visitor`, `exclusions`, `pages`,`
   historical`, `visitor_relationships`, `summary_totals`, and the add-on tables(`
   events`, `campaigns`, `goals`, `ar_outbox`).
 * Now, about the specific behavior you saw:
 * **”Total” going to 0** after the delete and reinstall is the expected result.
   The tables were dropped and recreated empty, so there is no historical data to
   total up.
 * **”Yesterday” being non-zero** is almost certainly not leftover data. The Yesterday
   bucket is calculated as the previous calendar day, not as “everything before 
   the reinstall”. So if you reinstalled the plugin at some point before midnight
   of yesterday, any real visits the tracker captured between reinstall time and
   23:59 yesterday land in that bucket as soon as the date rolls over. It is real
   new traffic, just bucketed under yesterday.
 * Two things would help confirm this and rule out a stale state:
 * 1. Could you check, via phpMyAdmin or any DB tool, whether these still have any
   rows after your delete + reinstall:
 *  `
    SELECT option_name FROM wp_options WHERE option_name LIKE ‘wp_statistics%’;
 *  SHOW TABLES LIKE ‘%statistics_%’;
    `
 *  If the only tables you see are the freshly recreated ones and they are mostly
   empty (a small number of rows in `visitor` / `pages` / `summary_totals` matching
   the time since the reinstall), that lines up with the explanation above.
 * 2. Are you running a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed, etc.)
   or an object cache (Redis, Memcached)? Cached dashboard widgets can keep showing
   old numbers for a while after a reinstall. Flushing the site cache and reloading
   the dashboard is worth a try.
 * One more thing worth knowing: you do not have to uninstall the plugin to wipe
   the data. WP Statistics has a built-in cleanup tool at **WP Statistics > Optimization
   > Purging**, which lets you purge data and visitors without removing the plugin.
 * If the SQL check above shows leftover rows or tables we did not expect, please
   paste the result back here and I will trace it.
 * Best regards,
 *  Thread Starter [tomdkat](https://wordpress.org/support/users/tomdkat/)
 * (@tomdkat)
 * [4 weeks, 1 day ago](https://wordpress.org/support/topic/question-about-old-data/#post-18906477)
 * Hi! Thanks for the great response!!!! So, if I use the “Purging” section to purge
   the data, should I expect all of the counts to reset to 0? I do use a caching
   plugin (WP Fastest Cache) but I believe I emptied the cache after removing the
   plugin, such that when I re-installed it, it would install correctly (not having
   cached data interfering).
   Thanks!
 *  Thread Starter [tomdkat](https://wordpress.org/support/users/tomdkat/)
 * (@tomdkat)
 * [4 weeks, 1 day ago](https://wordpress.org/support/topic/question-about-old-data/#post-18906480)
 * Ok, I’m logged into my dashboard now. When I go to ‘Statistics’ > ‘Optimization’
   I don’t see “Purging” but I see:
   Overview & InfoData ExportData CleanupPlugin
   MaintenanceHistorical DataI can see the overview info fine and it shows the amount
   of PHP memory being used, etc. When I click the other items, nothing happens.
   Are those premium features? If so, I’ll try the table deletion again and I’ll
   verify everything got deleted as expected.
 * Thanks!
 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [3 weeks, 5 days ago](https://wordpress.org/support/topic/question-about-old-data/#post-18909896)
 * Hi [@tomdkat](https://wordpress.org/support/users/tomdkat/),
   Two things to clear
   up, since my previous wording caused some of the confusion.**1) “Purging” vs 
   the label you actually see**In my earlier reply I called it “Purging”, but in
   the current plugin UI that tab is labeled **Data Cleanup**. So the five items
   you listed are the full set of Optimization tabs, and none of them are premium:–
   Overview & Info– Data Export– Data Cleanup (this is what I was calling Purging)–
   Plugin Maintenance– Historical DataThe full URL is `/wp-admin/admin.php?page=
   wps_optimization_page` if you want to jump straight to it.**2) “Nothing happens”
   when you click the other tabs**Those tabs switch via JavaScript (a `data-tab`
   handler in our `admin.min.js`). If clicking them does nothing at all, the JS 
   is not running on that page. In almost every case this turns out to be one of:–
   WP Fastest Cache serving a stale minified JS bundle. Please open WP Fastest Cache
   settings and click “Delete Cache and Minified CSS/JS”, then hard-reload the Optimization
   page (Ctrl+Shift+R / Cmd+Shift+R).– A JS error from another plugin earlier on
   the page, which stops our handler from binding. Open your browser DevTools (F12)
   > Console tab, click one of the unresponsive tabs, and copy any red error lines
   back into this thread.– Minify/combine JS turned on in WP Fastest Cache. If it
   is on, try temporarily disabling “Combine JS” and reloading.**3) Will Data Cleanup
   reset everything to 0?**Yes, effectively. On the Data Cleanup tab you have:– **
   Delete Records Older Than X Days** (minimum 30). Set this to 30 and click “Start
   Purging Now” to drop the vast majority of historical visits and visitor rows.–**
   Remove Visitors Exceeding X Views per day** (good for bot cleanup).– Remove User
   IDs, Clear User Agent Strings, Clear Word Count Data, Clean Up Recorded Query
   Parameters, and per-event / per-agent / per-IP deletes.Total / Yesterday / Today
   counters on the Traffic Overview are derived from those tables, so once the rows
   are gone the counters drop accordingly. Note that “Today” and “Yesterday” will
   start filling again immediately from live traffic, that is expected.Once you 
   can get into the Data Cleanup tab, try the “Delete Records Older Than 30 Days”
   action first and let me know what you see in the counters afterwards.Best regards,
    -  This reply was modified 3 weeks, 5 days ago by [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/).

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fquestion-about-old-data%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * Last activity: [3 weeks, 5 days ago](https://wordpress.org/support/topic/question-about-old-data/#post-18909896)
 * Status: resolved