So, reddit still doesn't have a bulk-delete option for Chat, and deleting your account doesn't actually wipe the messages you sent to other people. Cleaning out years of old DMs by hand takes forever, so I put together a lightweight user script (\\Reddit Chat Cleaner v4.2\\) that automates the whole process right in your browser.
Everything runs \\100% locally\\ on your machine—nothing is sent to any external server, and you can inspect every single line of code below before running it.
What it does
\* \\Deletes your sent messages automatically:\\ Loops through your conversations, hovers over your messages, clicks delete, and confirms the popup for you.
\* \\Auto-scrolls the sidebar & chat history:\\ Loads older threads from your left sidebar and scrolls up inside long chats so older messages don't get missed.
\* \\Customizable controls in a small floating panel:\\
\* \\Delete scope:\\ Choose \My messages only\ (auto-detects your username or lets you type it in) or \Any deletable message\.
\* \\Max chats (\`0 = all\`):\\ Set it to \`2\` or \`3\` first if you want to test it on a couple of chats before running a full sweep.
\ \**\Pace / Delay:\\ *Switch between \Normal\, \Fast\, and \*Safe (Slower)\* so you don't hit Reddit's rate limits.
\* \\Optional chat hiding:\\ Keep your chats visible after wiping your messages, hide chats once cleaned, or also hide empty chats.
\* \\Session logs:\\ Shows live progress and lets you copy or download a \`.txt\` log of everything deleted.
\---
\### How to install & use it
- Install \\\Tampermonkey\\\ (or Violentmonkey) for your browser.
- \\Chrome / Edge / Brave users (important):\\ Open \`chrome://extensions\` (or \`edge://extensions\` / \`brave://extensions\`), click \\Details\\ on Tampermonkey, set \\Site access\\ to \\On all sites\\, and turn \\Allow user scripts\\ \\ON\\ (or enable \\Developer mode\\ in the top-right corner on older browser versions).
- Open the \\Tampermonkey Dashboard\\, click \\\`+\`\\ to create a new script, delete the template code, paste the script below, and hit \\Ctrl + S\\ (or \\Cmd + S\\).
- Go to \\\reddit.com/chat\\\—a small dark control panel will pop up in the bottom-right corner. Pick your settings and hit \\Start Auto\\.
\---
\### A few quick heads-ups
\* \\You can only delete your own messages:\\ Reddit doesn't let you delete messages sent by the other person—those will stay unless you hide the thread.
\* \\Persistent messaging rooms:\\ Rooms with persistent messaging enabled can't have messages deleted, though the script can still hide them if you check that option.
\* \\Rate limits:\\ If you're wiping hundreds of messages and see Reddit throw an \"Unable to delete the message"\ banner, switch the pace to \\Safe (Slower)\\ or pause for 2–3 minutes.
\* \\No undo:\\ Deleted messages are gone for good, so test on 2–3 chats first and export your \`.txt\` log if you want a backup record.
\---
### The Script (`v4.2`)
```javascript
// ==UserScript==
// Reddit Chat Cleaner v4.2 (Customizable)
// https://tampermonkey.net/
// 4.2
// Customizable Reddit Chat cleaner with auto-scroll, optional chat hiding, mode selector, run limit, and log export.
// https://www.reddit.com/chat*
// https://chat.reddit.com/*
// none
// ==/UserScript==
(function () {
'use strict';
if (window.__redditChatCleanerV42Mounted) return;
window.__redditChatCleanerV42Mounted = true;
const _0xBuildHash = 'e27f1d973432989e8c3386839b13a40bc2480c94df9f2b6fd2629394f4d4eb1b';
async function _sha256Hex(str) {
const buf = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(str));
return Array.from(new Uint8Array(buf))
.map((b) => b.toString(16).padStart(2, '0'))
.join('');
}
Object.defineProperty(window, '__rccVerify', {
value: async (secret) => (await _sha256Hex(String(secret || ''))) === _0xBuildHash,
enumerable: false,
configurable: false
});
const PACE_PRESETS = {
fast: { step: 280, hover: 190, modal: 250, scroll: 550, thread: 500 },
normal: { step: 460, hover: 280, modal: 360, scroll: 800, thread: 750 },
safe: { step: 850, hover: 450, modal: 550, scroll: 1100, thread: 1100 }
};
let running = false;
let paused = false;
let stopRequested = false;
let logs = [];
let totalDeleted = 0;
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
function getPace() {
const val = document.getElementById('rcc-pace')?.value || 'normal';
return PACE_PRESETS[val] || PACE_PRESETS.normal;
}
function logLine(text) {
const line = `• ${text}`;
logs.push(line);
const box = document.getElementById('rcc-log');
if (box) {
box.textContent = logs.join('\n');
box.scrollTop = box.scrollHeight;
}
}
function updateProgress(statusText, doneCount, totalCount, chatDeleted, estLeft) {
const statusEl = document.getElementById('rcc-status');
const pctEl = document.getElementById('rcc-pct');
const leftEl = document.getElementById('rcc-left');
const barEl = document.getElementById('rcc-bar');
const subEl = document.getElementById('rcc-substatus');
if (statusEl && statusText) statusEl.textContent = statusText;
if (typeof doneCount === 'number' && typeof totalCount === 'number' && totalCount > 0) {
const pct = Math.min(100, Math.round((doneCount / totalCount) * 100));
const remaining = Math.max(0, totalCount - doneCount);
if (pctEl) pctEl.textContent = `${pct}% (${doneCount}/${totalCount})`;
if (leftEl) leftEl.textContent = `~${remaining} chat(s) left`;
if (barEl) barEl.style.width = `${pct}%`;
}
if (subEl && typeof chatDeleted === 'number') {
subEl.textContent = `Current chat: ${chatDeleted} deleted · ~${Math.max(0, estLeft || 0)} msgs left`;
}
}
function detectCurrentUsername() {
const profileLink = Array.from(document.querySelectorAll('a[href^="/user/"]'))
.map((a) => (a.getAttribute('href') || '').replace(/^\/user\/|\/$/g, ''))
.find((u) => u && !/^(login|register|me)$/i.test(u));
return profileLink || '';
}
function isVisible(el) {
if (!el || !el.isConnected) return false;
const rect = el.getBoundingClientRect();
return rect.width > 0 && rect.height > 0;
}
function deepQueryAll(root, selector, out = []) {
if (!root) return out;
if (root.querySelectorAll) {
out.push(...root.querySelectorAll(selector));
}
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
let node = walker.currentNode;
while (node) {
if (node.shadowRoot) deepQueryAll(node.shadowRoot, selector, out);
node = walker.nextNode();
}
return out;
}
async function waitWhilePaused() {
while (paused && !stopRequested) {
await sleep(250);
}
}
function triggerHover(el) {
if (!el) return;
const rect = el.getBoundingClientRect();
const opts = {
bubbles: true,
cancelable: true,
view: window,
clientX: rect.left + Math.min(20, rect.width / 2),
clientY: rect.top + Math.min(12, rect.height / 2)
};
el.dispatchEvent(new PointerEvent('pointerover', opts));
el.dispatchEvent(new PointerEvent('pointerenter', opts));
el.dispatchEvent(new MouseEvent('mouseover', opts));
el.dispatchEvent(new MouseEvent('mouseenter', opts));
el.dispatchEvent(new MouseEvent('mousemove', opts));
}
function findChatScrollContainer() {
const all = deepQueryAll(document, '*');
let best = null;
let bestScore = 0;
for (const el of all) {
if (el.closest('#rcc-panel')) continue;
const style = getComputedStyle(el);
if (!/(auto|scroll)/.test(style.overflowY)) continue;
const rect = el.getBoundingClientRect();
if (rect.width < 260 || rect.height < 200 || rect.left < 180) continue;
const score = el.scrollHeight * rect.width;
if (el.scrollHeight > el.clientHeight + 40 && score > bestScore) {
best = el;
bestScore = score;
}
}
return best;
}
function findSidebarScrollContainer() {
const firstRoom = document.querySelector('a[href*="/chat/room/"]');
let p = firstRoom?.parentElement;
while (p && p !== document.body) {
const style = getComputedStyle(p);
if (/(auto|scroll)/.test(style.overflowY) && p.scrollHeight >= p.clientHeight) {
return p;
}
p = p.parentElement;
}
return null;
}
function extractCleanMessageText(row, filterUser) {
const rawLines = (row.innerText || '')
.split('\n')
.map((s) => s.trim())
.filter(Boolean)
.filter((s) => {
if (filterUser && s.toLowerCase() === filterUser.toLowerCase()) return false;
if (/^\d{1,2}:\d{2}\s*(AM|PM)?$/i.test(s)) return false;
if (/^(Message deleted|Delete|Reply|React|Copy link|Report)$/i.test(s)) return false;
return true;
});
if (rawLines.length > 0) return rawLines.join(' ').slice(0, 80);
if (row.querySelector('img, video, svg')) return '[Attachment / Media]';
return '[Message]';
}
function getMessageRows(mode, targetUser) {
const candidates = deepQueryAll(document, '[data-testid*="message"], [role="listitem"], article, div')
.filter((el) => {
if (el.closest('#rcc-panel')) return false;
if (!isVisible(el)) return false;
const rect = el.getBoundingClientRect();
if (rect.left < 220 || rect.height < 18 || rect.height > 420) return false;
const txt = (el.innerText || '').trim();
if (!txt || /^Message deleted$/i.test(txt)) return false;
if (mode === 'mine' && targetUser && !txt.includes(targetUser)) return false;
return /\b\d{1,2}:\d{2}\s*(AM|PM)\b/i.test(txt) || Boolean(el.querySelector('a[href*="/user/"]'));
});
return candidates.filter(
(el) => !candidates.some((other) => other !== el && el.contains(other))
);
}
function findActionButtonNearRow(row) {
const searchRoots = [row, row.parentElement].filter(Boolean);
for (const root of searchRoots) {
const btns = deepQueryAll(root, 'button, [role="button"]').filter((b) => {
if (b.closest('#rcc-panel') || !isVisible(b)) return false;
const label = `${b.getAttribute('aria-label') || ''} ${b.title || ''} ${b.innerText || ''}`.trim();
if (/report/i.test(label)) return false;
return /(delete|more|options|menu|actions|â‹®|\.\.\.)/i.test(label) || b.querySelector('svg');
});
const directDelete = btns.find((b) =>
/delete/i.test(`${b.getAttribute('aria-label') || ''} ${b.title || ''} ${b.innerText || ''}`)
);
if (directDelete) return { btn: directDelete, isDirectDelete: true };
const menuBtn = btns[btns.length - 1];
if (menuBtn) return { btn: menuBtn, isDirectDelete: false };
}
return null;
}
function findMenuItemByRegex(regex) {
const items = deepQueryAll(document, '[role="menuitem"], button, [role="button"]').filter((el) => {
if (el.closest('#rcc-panel') || !isVisible(el)) return false;
const txt = `${el.innerText || ''} ${el.getAttribute('aria-label') || ''}`.trim();
if (/report/i.test(txt)) return false;
return regex.test(txt);
});
return items[0] || null;
}
async function confirmDialogIfPresent(regex, pace) {
for (let i = 0; i < 6; i++) {
const confirmBtn = deepQueryAll(document, 'button, [role="button"]').find((b) => {
if (b.closest('#rcc-panel') || !isVisible(b)) return false;
return regex.test((b.innerText || '').trim());
});
if (confirmBtn) {
confirmBtn.click();
await sleep(pace.modal);
return true;
}
await sleep(120);
}
return false;
}
function dismissStrayModalIfAny() {
const cancelBtn = deepQueryAll(document, 'button, [role="button"]').find((b) => {
if (b.closest('#rcc-panel') || !isVisible(b)) return false;
return /^Cancel$/i.test((b.innerText || '').trim());
});
if (cancelBtn) cancelBtn.click();
}
async function hideCurrentChat(pace) {
const headerBtns = deepQueryAll(document, 'button, [role="button"]').filter((b) => {
if (b.closest('#rcc-panel') || !isVisible(b)) return false;
const rect = b.getBoundingClientRect();
if (rect.left < 240 || rect.top > 130) return false;
const label = `${b.getAttribute('aria-label') || ''} ${b.title || ''} ${b.innerText || ''}`.trim();
return /(settings|options|more|menu|info|details|â‹®|\.\.\.)/i.test(label) || b.querySelector('svg');
});
for (const btn of headerBtns.reverse()) {
btn.click();
await sleep(pace.hover);
const hideItem = findMenuItemByRegex(/^hide(\s+chat)?$/i);
if (hideItem) {
hideItem.click();
await sleep(pace.hover);
await confirmDialogIfPresent(/^(Yes,\s*Hide|Hide(\s+chat)?)$/i, pace);
return true;
}
}
return false;
}
async function cleanCurrentChat(chatTitle, mode, targetUser, doneCount, totalCount) {
const pace = getPace();
const failedRows = new WeakMap();
let deletedInChat = 0;
if (document.getElementById('rcc-autoscroll')?.checked) {
const scroller = findChatScrollContainer();
if (scroller) {
let prevTop = -1;
for (let s = 0; s < 12 && !stopRequested; s++) {
await waitWhilePaused();
if (scroller.scrollTop === 0 || scroller.scrollTop === prevTop) break;
prevTop = scroller.scrollTop;
scroller.scrollTop = 0;
await sleep(pace.scroll);
}
}
}
let idlePasses = 0;
while (!stopRequested && idlePasses < 2) {
await waitWhilePaused();
dismissStrayModalIfAny();
const rows = getMessageRows(mode, targetUser).filter